---
title: "What can Depolarize the Polarizers? Affective Polarization for Party Activists Before and After Elections - Replication file" 
authors: Costin Ciobanu and Dani Sandu
date: 17 April 2024
journal: Comparative Political Studies (2024)
---

# R version

The analysis was conducted using R version 4.3.2 (2023-10-31).

# Code and data credits

For some balance tests, we use R code taken from Hartman and Hidalgo (2018). We are grateful for the opportunity to make use of their work. Furthermore, we utilize data sourced from the European Social Survey (wave 9) for supplementary analyses. We extend our gratitude to those involved in data collection.

# Load packages and relevant functions/themes

```{r}

# Load relevant packages
pacman::p_load(foreign, psych, texreg, tidyverse, dplyr, plyr, data.table, readxl, grid, gridExtra, zoo, MASS, miceadds, gdata, tidyquant, scales, patchwork, ebal, lfe, haven, lubridate, readtext, cobalt, estimatr, xtable, ggthemes, ggpubr, fastDummies, kableExtra, randomizr, gghighlight, ggrepel, mosaic, sciplot, stringi, knitr, margins, sjPlot, stats, stargazer, effects, diagis)

# Select function
`%nin%` <- function (x, table) is.na(match(x, table, nomatch=NA_integer_))

# Plot theme (ggplot)
theme = theme_bw() +
  theme(plot.title = element_text(colour = "blue", hjust = 0.5),
        axis.title.y = element_text(size = 28),
        axis.title.x = element_text(size = 28),
        strip.text.x = element_text(size = 20, face="bold"),
        strip.text.y = element_text(size = 20, face="bold"),
        axis.text.x = element_text(size=20),
        axis.text.y = element_text(size=20),
        legend.title = element_text(size = 20),
        legend.text = element_text(size = 20))
```

# Load main datasets

```{r}

# Wave 1
wave1_usrplus <- readRDS("Wave1.RDS")

# Wave 2
wave2_usrplus <- readRDS("Wave2.RDS")

# Wave 3
wave3_usrplus <- readRDS("Wave3.RDS")
```

# Data merge - panel data

```{r}

# Merge data (long-panel format)
w12_long = merge(wave1_usrplus, wave2_usrplus, all = T)
w13_long = merge(wave1_usrplus, wave3_usrplus, all = T)

# Panel data - keep only observations measured twice
w12_long = w12_long %>%
  group_by(RecipientFirstName) %>% 
  filter(n()==2)

w13_long = w13_long %>%
  group_by(RecipientFirstName) %>% 
  filter(n()==2)

# Data checks
w12_long %>%
  group_by(Delegate_vote_total, Wave) %>%
  count()

w13_long %>%
  group_by(Delegate_vote_total, Wave) %>%
  count()
```

# Data transformations

## Standardize DVs and other variables - panel waves 1 and 2 (w12)

```{r}

# Affective polarization (difference) USR-PLUS vs. PSD

w12_long$Thermo_diff_PSD_leaders_s = (w12_long$Thermo_diff_PSD_leaders - mean(w12_long$Thermo_diff_PSD_leaders, na.rm = T))/sd(w12_long$Thermo_diff_PSD_leaders, na.rm = T)

w12_long$Thermo_diff_PSD_s = (w12_long$Thermo_diff_PSD - mean(w12_long$Thermo_diff_PSD, na.rm = T))/sd(w12_long$Thermo_diff_PSD, na.rm = T)

w12_long$Thermo_diff_PSD_members_s = (w12_long$Thermo_diff_PSD_members - mean(w12_long$Thermo_diff_PSD_members, na.rm = T))/sd(w12_long$Thermo_diff_PSD_members, na.rm = T)

w12_long$Thermo_diff_PSD_voters_s = (w12_long$Thermo_diff_PSD_voters - mean(w12_long$Thermo_diff_PSD_voters, na.rm = T))/sd(w12_long$Thermo_diff_PSD_voters, na.rm = T)


w12_long$Good_diff_PSD_leaders_s = (w12_long$Good_diff_PSD_leaders - mean(w12_long$Good_diff_PSD_leaders, na.rm = T))/sd(w12_long$Good_diff_PSD_leaders, na.rm = T)

w12_long$Good_diff_PSD_s = (w12_long$Good_diff_PSD - mean(w12_long$Good_diff_PSD, na.rm = T))/sd(w12_long$Good_diff_PSD, na.rm = T)

w12_long$Good_diff_PSD_members_s = (w12_long$Good_diff_PSD_members - mean(w12_long$Good_diff_PSD_members, na.rm = T))/sd(w12_long$Good_diff_PSD_members, na.rm = T)

w12_long$Good_diff_PSD_voters_s = (w12_long$Good_diff_PSD_voters - mean(w12_long$Good_diff_PSD_voters, na.rm = T))/sd(w12_long$Good_diff_PSD_voters, na.rm = T)


# Affective polarization (difference) USR-PLUS vs. PNL

w12_long$Thermo_diff_PNL_leaders_s = (w12_long$Thermo_diff_PNL_leaders - mean(w12_long$Thermo_diff_PNL_leaders, na.rm = T))/sd(w12_long$Thermo_diff_PNL_leaders, na.rm = T)

w12_long$Thermo_diff_PNL_s = (w12_long$Thermo_diff_PNL - mean(w12_long$Thermo_diff_PNL, na.rm = T))/sd(w12_long$Thermo_diff_PNL, na.rm = T)

w12_long$Thermo_diff_PNL_members_s = (w12_long$Thermo_diff_PNL_members - mean(w12_long$Thermo_diff_PNL_members, na.rm = T))/sd(w12_long$Thermo_diff_PNL_members, na.rm = T)

w12_long$Thermo_diff_PNL_voters_s = (w12_long$Thermo_diff_PNL_voters - mean(w12_long$Thermo_diff_PNL_voters, na.rm = T))/sd(w12_long$Thermo_diff_PNL_voters, na.rm = T)


w12_long$Good_diff_PNL_leaders_s = (w12_long$Good_diff_PNL_leaders - mean(w12_long$Good_diff_PNL_leaders, na.rm = T))/sd(w12_long$Good_diff_PNL_leaders, na.rm = T)

w12_long$Good_diff_PNL_s = (w12_long$Good_diff_PNL - mean(w12_long$Good_diff_PNL, na.rm = T))/sd(w12_long$Good_diff_PNL, na.rm = T)

w12_long$Good_diff_PNL_members_s = (w12_long$Good_diff_PNL_members - mean(w12_long$Good_diff_PNL_members, na.rm = T))/sd(w12_long$Good_diff_PNL_members, na.rm = T)

w12_long$Good_diff_PNL_voters_s = (w12_long$Good_diff_PNL_voters - mean(w12_long$Good_diff_PNL_voters, na.rm = T))/sd(w12_long$Good_diff_PNL_voters, na.rm = T)


# PSD scores

w12_long$Thermo_PSD_leaders_s = (w12_long$Thermo_PSD_leaders - mean(w12_long$Thermo_PSD_leaders, na.rm = T))/sd(w12_long$Thermo_PSD_leaders, na.rm = T)

w12_long$Thermo_PSD_s = (w12_long$Thermo_PSD - mean(w12_long$Thermo_PSD, na.rm = T))/sd(w12_long$Thermo_PSD, na.rm = T)

w12_long$Thermo_PSD_members_s = (w12_long$Thermo_PSD_members - mean(w12_long$Thermo_PSD_members, na.rm = T))/sd(w12_long$Thermo_PSD_members, na.rm = T)

w12_long$Thermo_PSD_voters_s = (w12_long$Thermo_PSD_voters - mean(w12_long$Thermo_PSD_voters, na.rm = T))/sd(w12_long$Thermo_PSD_voters, na.rm = T)


w12_long$Good_PSD_leaders_s = (w12_long$Good_PSD_leaders - mean(w12_long$Good_PSD_leaders, na.rm = T))/sd(w12_long$Good_PSD_leaders, na.rm = T)

w12_long$Good_PSD_s = (w12_long$Good_PSD - mean(w12_long$Good_PSD, na.rm = T))/sd(w12_long$Good_PSD, na.rm = T)

w12_long$Good_PSD_members_s = (w12_long$Good_PSD_members - mean(w12_long$Good_PSD_members, na.rm = T))/sd(w12_long$Good_PSD_members, na.rm = T)

w12_long$Good_PSD_voters_s = (w12_long$Good_PSD_voters - mean(w12_long$Good_PSD_voters, na.rm = T))/sd(w12_long$Good_PSD_voters, na.rm = T)


# PNL scores

w12_long$Thermo_PNL_leaders_s = (w12_long$Thermo_PNL_leaders - mean(w12_long$Thermo_PNL_leaders, na.rm = T))/sd(w12_long$Thermo_PNL_leaders, na.rm = T)

w12_long$Thermo_PNL_s = (w12_long$Thermo_PNL - mean(w12_long$Thermo_PNL, na.rm = T))/sd(w12_long$Thermo_PNL, na.rm = T)

w12_long$Thermo_PNL_members_s = (w12_long$Thermo_PNL_members - mean(w12_long$Thermo_PNL_members, na.rm = T))/sd(w12_long$Thermo_PNL_members, na.rm = T)

w12_long$Thermo_PNL_voters_s = (w12_long$Thermo_PNL_voters - mean(w12_long$Thermo_PNL_voters, na.rm = T))/sd(w12_long$Thermo_PNL_voters, na.rm = T)


w12_long$Good_PNL_leaders_s = (w12_long$Good_PNL_leaders - mean(w12_long$Good_PNL_leaders, na.rm = T))/sd(w12_long$Good_PNL_leaders, na.rm = T)

w12_long$Good_PNL_s = (w12_long$Good_PNL - mean(w12_long$Good_PNL, na.rm = T))/sd(w12_long$Good_PNL, na.rm = T)

w12_long$Good_PNL_members_s = (w12_long$Good_PNL_members - mean(w12_long$Good_PNL_members, na.rm = T))/sd(w12_long$Good_PNL_members, na.rm = T)

w12_long$Good_PNL_voters_s = (w12_long$Good_PNL_voters - mean(w12_long$Good_PNL_voters, na.rm = T))/sd(w12_long$Good_PNL_voters, na.rm = T)


# Social identity USR-PLUS

w12_long$Identity_USRPLUS_s = (w12_long$Identity_USRPLUS - mean(w12_long$Identity_USRPLUS, na.rm = T))/sd(w12_long$Identity_USRPLUS, na.rm = T)
```

## Standardize DVs and other variables - panel waves 1 and 3 (w13)

```{r}

# Affective polarization (difference) USR-PLUS vs. PSD

w13_long$Thermo_diff_PSD_leaders_s = (w13_long$Thermo_diff_PSD_leaders - mean(w13_long$Thermo_diff_PSD_leaders, na.rm = T))/sd(w13_long$Thermo_diff_PSD_leaders, na.rm = T)

w13_long$Thermo_diff_PSD_s = (w13_long$Thermo_diff_PSD - mean(w13_long$Thermo_diff_PSD, na.rm = T))/sd(w13_long$Thermo_diff_PSD, na.rm = T)

w13_long$Thermo_diff_PSD_members_s = (w13_long$Thermo_diff_PSD_members - mean(w13_long$Thermo_diff_PSD_members, na.rm = T))/sd(w13_long$Thermo_diff_PSD_members, na.rm = T)

w13_long$Thermo_diff_PSD_voters_s = (w13_long$Thermo_diff_PSD_voters - mean(w13_long$Thermo_diff_PSD_voters, na.rm = T))/sd(w13_long$Thermo_diff_PSD_voters, na.rm = T)


w13_long$Good_diff_PSD_leaders_s = (w13_long$Good_diff_PSD_leaders - mean(w13_long$Good_diff_PSD_leaders, na.rm = T))/sd(w13_long$Good_diff_PSD_leaders, na.rm = T)

w13_long$Good_diff_PSD_s = (w13_long$Good_diff_PSD - mean(w13_long$Good_diff_PSD, na.rm = T))/sd(w13_long$Good_diff_PSD, na.rm = T)

w13_long$Good_diff_PSD_members_s = (w13_long$Good_diff_PSD_members - mean(w13_long$Good_diff_PSD_members, na.rm = T))/sd(w13_long$Good_diff_PSD_members, na.rm = T)

w13_long$Good_diff_PSD_voters_s = (w13_long$Good_diff_PSD_voters - mean(w13_long$Good_diff_PSD_voters, na.rm = T))/sd(w13_long$Good_diff_PSD_voters, na.rm = T)


# Affective polarization (difference) USR-PLUS vs. PNL

w13_long$Thermo_diff_PNL_leaders_s = (w13_long$Thermo_diff_PNL_leaders - mean(w13_long$Thermo_diff_PNL_leaders, na.rm = T))/sd(w13_long$Thermo_diff_PNL_leaders, na.rm = T)

w13_long$Thermo_diff_PNL_s = (w13_long$Thermo_diff_PNL - mean(w13_long$Thermo_diff_PNL, na.rm = T))/sd(w13_long$Thermo_diff_PNL, na.rm = T)

w13_long$Thermo_diff_PNL_members_s = (w13_long$Thermo_diff_PNL_members - mean(w13_long$Thermo_diff_PNL_members, na.rm = T))/sd(w13_long$Thermo_diff_PNL_members, na.rm = T)

w13_long$Thermo_diff_PNL_voters_s = (w13_long$Thermo_diff_PNL_voters - mean(w13_long$Thermo_diff_PNL_voters, na.rm = T))/sd(w13_long$Thermo_diff_PNL_voters, na.rm = T)


w13_long$Good_diff_PNL_leaders_s = (w13_long$Good_diff_PNL_leaders - mean(w13_long$Good_diff_PNL_leaders, na.rm = T))/sd(w13_long$Good_diff_PNL_leaders, na.rm = T)

w13_long$Good_diff_PNL_s = (w13_long$Good_diff_PNL - mean(w13_long$Good_diff_PNL, na.rm = T))/sd(w13_long$Good_diff_PNL, na.rm = T)

w13_long$Good_diff_PNL_members_s = (w13_long$Good_diff_PNL_members - mean(w13_long$Good_diff_PNL_members, na.rm = T))/sd(w13_long$Good_diff_PNL_members, na.rm = T)

w13_long$Good_diff_PNL_voters_s = (w13_long$Good_diff_PNL_voters - mean(w13_long$Good_diff_PNL_voters, na.rm = T))/sd(w13_long$Good_diff_PNL_voters, na.rm = T)


# PSD scores

w13_long$Thermo_PSD_leaders_s = (w13_long$Thermo_PSD_leaders - mean(w13_long$Thermo_PSD_leaders, na.rm = T))/sd(w13_long$Thermo_PSD_leaders, na.rm = T)

w13_long$Thermo_PSD_s = (w13_long$Thermo_PSD - mean(w13_long$Thermo_PSD, na.rm = T))/sd(w13_long$Thermo_PSD, na.rm = T)

w13_long$Thermo_PSD_members_s = (w13_long$Thermo_PSD_members - mean(w13_long$Thermo_PSD_members, na.rm = T))/sd(w13_long$Thermo_PSD_members, na.rm = T)

w13_long$Thermo_PSD_voters_s = (w13_long$Thermo_PSD_voters - mean(w13_long$Thermo_PSD_voters, na.rm = T))/sd(w13_long$Thermo_PSD_voters, na.rm = T)


w13_long$Good_PSD_leaders_s = (w13_long$Good_PSD_leaders - mean(w13_long$Good_PSD_leaders, na.rm = T))/sd(w13_long$Good_PSD_leaders, na.rm = T)

w13_long$Good_PSD_s = (w13_long$Good_PSD - mean(w13_long$Good_PSD, na.rm = T))/sd(w13_long$Good_PSD, na.rm = T)

w13_long$Good_PSD_members_s = (w13_long$Good_PSD_members - mean(w13_long$Good_PSD_members, na.rm = T))/sd(w13_long$Good_PSD_members, na.rm = T)

w13_long$Good_PSD_voters_s = (w13_long$Good_PSD_voters - mean(w13_long$Good_PSD_voters, na.rm = T))/sd(w13_long$Good_PSD_voters, na.rm = T)


# PNL scores

w13_long$Thermo_PNL_leaders_s = (w13_long$Thermo_PNL_leaders - mean(w13_long$Thermo_PNL_leaders, na.rm = T))/sd(w13_long$Thermo_PNL_leaders, na.rm = T)

w13_long$Thermo_PNL_s = (w13_long$Thermo_PNL - mean(w13_long$Thermo_PNL, na.rm = T))/sd(w13_long$Thermo_PNL, na.rm = T)

w13_long$Thermo_PNL_members_s = (w13_long$Thermo_PNL_members - mean(w13_long$Thermo_PNL_members, na.rm = T))/sd(w13_long$Thermo_PNL_members, na.rm = T)

w13_long$Thermo_PNL_voters_s = (w13_long$Thermo_PNL_voters - mean(w13_long$Thermo_PNL_voters, na.rm = T))/sd(w13_long$Thermo_PNL_voters, na.rm = T)


w13_long$Good_PNL_leaders_s = (w13_long$Good_PNL_leaders - mean(w13_long$Good_PNL_leaders, na.rm = T))/sd(w13_long$Good_PNL_leaders, na.rm = T)

w13_long$Good_PNL_s = (w13_long$Good_PNL - mean(w13_long$Good_PNL, na.rm = T))/sd(w13_long$Good_PNL, na.rm = T)

w13_long$Good_PNL_members_s = (w13_long$Good_PNL_members - mean(w13_long$Good_PNL_members, na.rm = T))/sd(w13_long$Good_PNL_members, na.rm = T)

w13_long$Good_PNL_voters_s = (w13_long$Good_PNL_voters - mean(w13_long$Good_PNL_voters, na.rm = T))/sd(w13_long$Good_PNL_voters, na.rm = T)


# Social identity USR-PLUS

w13_long$Identity_USRPLUS_s = (w13_long$Identity_USRPLUS - mean(w13_long$Identity_USRPLUS, na.rm = T))/sd(w13_long$Identity_USRPLUS, na.rm = T)
```

## Delegate variable (for DID estimations)

```{r}

# Build treatment variable for DID estimations
w12_long = mutate(w12_long,
                  
                  Delegate_v2 = case_when(
                  (Wave %in% 1) & (!is.na(Delegate_vote_total)) ~ 0,
                  (Wave %in% 2) & (Delegate_vote_total %in% 0)  ~ 0,
                  (Wave %in% 2) & (Delegate_vote_total %in% 1)  ~ 1,
                  TRUE ~ as.double(NA)))


w13_long = mutate(w13_long,
                  
                  Delegate_v2 = case_when(
                  (Wave %in% 1) & (!is.na(Delegate_vote_total)) ~ 0,
                  (Wave %in% 3) & (Delegate_vote_total %in% 0)  ~ 0,
                  (Wave %in% 3) & (Delegate_vote_total %in% 1)  ~ 1,
                  is.na(Delegate_vote_total) ~ as.double(NA),
                  TRUE ~ as.double(NA)))

# Checks
w12_long %>%
group_by(Wave) %>%
count(Delegate_v2)

w13_long %>%
group_by(Wave) %>%
count(Delegate_v2)
```

# Main paper

## Election day activity - non-delegates

```{r}

# Election day activity for non-delegates

w12_long %>%
  dplyr::select(Nondelegates_activity_votingday, Delegate_vote_total, Wave) %>%
  group_by(Delegate_vote_total, Wave) %>%
  count(Nondelegates_activity_votingday) %>%
  filter(Delegate_vote_total == 0) %>%
  filter(!is.na(Nondelegates_activity_votingday))
```

## Previous election delegate or observer

```{r}

# Previously serving as precinct delegate or election observer (first wave of data; all party activists)

summary(as.factor(wave1_usrplus$Past_delegate_observer_yes))
```

## Reason for delegate assignment

```{r}

# Reason for being delegated to a precinct - Random distribution as an option

w12_long %>%
  dplyr::select(Precinct_reason_delegate, Delegate_vote_total, Wave) %>%
  group_by(Delegate_vote_total, Wave) %>%
  count(Precinct_reason_delegate) %>%
  filter((Wave == 2) & (Delegate_vote_total == 1))
```

## Election salience - dates

```{r}

# Percentage of observations collected in the first three days of data collection (the post-election wave - Wave 2)

w12_long %>%
  dplyr::select(Date, Wave) %>%
  filter(Wave != 1) %>%
  group_by(Date) %>%
  count(Date)
```

## Motivation to be a delegate

```{r}

# Motivation to be a delegate (0 - 10 scale, 0 - Interest for the elections to be fair; 10 - Interest for the party to win)

w12_long %>%
  dplyr::select(Precinct_party_win, Delegate_vote_total, Wave) %>%
  group_by(Delegate_vote_total, Wave) %>%
  dplyr::summarise(mean = mean(Precinct_party_win, na.rm = T),
            se = se(Precinct_party_win, na.rm = T)) %>%
  filter((Wave == 2) & (Delegate_vote_total == 1))
```

## Figure 1

```{r}

# Interactions

interact12 = w12_long %>%
  mutate(Interactions_PSD = case_when(
    Precinct_interactions_PSD %in% "No interactions" ~ 0,
    Precinct_interactions_PSD %in% c("Neutral", "Tensed", "Relaxed") ~ 1,
    TRUE ~ as.double(NA)),
    Interactions_PNL = case_when(
      Precinct_interactions_PNL %in% "No interactions" ~ 0,
      Precinct_interactions_PNL %in% c("Neutral", "Tensed", "Relaxed") ~ 1,
      TRUE ~ as.double(NA))) %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Interactions_PSD, Interactions_PNL) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  dplyr::summarise(mean = mean(Value, na.rm = T),
            se = se(Value, na.rm = T)) %>%
  filter(!is.na(mean))

interact13 =  w13_long %>%
  mutate(Interactions_PSD = case_when(
    Precinct_interactions_PSD %in% "No interactions" ~ 0,
    Precinct_interactions_PSD %in% c("Neutral", "Tensed", "Relaxed") ~ 1,
    TRUE ~ as.double(NA)),
    Interactions_PNL = case_when(
      Precinct_interactions_PNL %in% "No interactions" ~ 0,
      Precinct_interactions_PNL %in% c("Neutral", "Tensed", "Relaxed") ~ 1,
      TRUE ~ as.double(NA))) %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Interactions_PSD, Interactions_PNL) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  dplyr::summarise(mean = mean(Value, na.rm = T),
            se = se(Value, na.rm = T)) %>%
  filter(!is.na(mean))

interactions = rbind(interact12, interact13)
interactions$Wave = c("Panel data (Wave 2)", "Panel data (Wave 2)", "Panel data (Wave 3)", "Panel data (Wave 3)")
interactions$Variable = c("PNL", "PSD", "PNL", "PSD")

interactions %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                           levels = c("PSD",  "PNL"),
                           labels = c("PSD",  "PNL")),
         Wave = factor(Wave, ordered = TRUE, 
                       levels = c("Panel data (Wave 3)", "Panel data (Wave 3)", "Panel data (Wave 2)",  "Panel data (Wave 2)"),
                       labels = c("Panel data\n(Wave 3)", "Panel data\n(Wave 3)", "Panel data\n(Wave 2)", "Panel data\n(Wave 2)"))) %>%
  ggplot(aes(x = Wave, y = mean)) +
  geom_col(aes(color = Variable), width = 0.3, fill = "white", size = 2) +  
  geom_errorbar(aes(ymin = mean - 1.96*se, ymax = mean + 1.96*se), width = 0, position=position_dodge(.8), size = 2) +
  scale_y_continuous(labels = percent, limits = c(0, 1)) +
  labs(x = "", y = "Percentage of USR-PLUS delegates reporting interactions with other parties'\n delegates, by party and panel data waves") +  
  facet_grid(~Variable) +  
  coord_flip() +
  theme_bw()  +
  theme(plot.title = element_text(hjust = 0.5)) +
  theme(text = element_text(size=20)) +
  theme(strip.text.x = element_text(size = 20, face="bold")) +
  theme(strip.text.y = element_text(size = 20, face="bold")) +
  theme(axis.text.x= element_text(size = 20, vjust = 1, hjust = 0.5)) +
  theme(axis.text.y = element_text(size = 20)) +
  theme(axis.title.x= element_text(size = 26)) +
  theme(axis.title.y = element_text(size = 26)) +
  theme(legend.position = "none") +
  scale_color_manual(values = c("red", "blue"))

ggsave("Plots/Figure1_Evidence_contact_interactions.pdf", dpi = 1200, width = 15, height = 7.5, unit = "in")

# Discussions

discuss12 =  w12_long %>%
  mutate(Discussions_PSD = case_when(
  Precinct_discussions_PSD %in% c("No") ~ 0,
  Precinct_discussions_PSD %in% c("Yes") ~ 1,
  TRUE ~ as.double(NA)),
Discussions_PNL = case_when(
  Precinct_discussions_PNL %in% c("No") ~ 0,
  Precinct_discussions_PNL %in% c("Yes") ~ 1,
  TRUE ~ as.double(NA))) %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Discussions_PSD, Discussions_PNL) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  dplyr::summarise(mean = mean(Value, na.rm = T),
            se = se(Value, na.rm = T)) %>%
  filter(!is.na(mean))

discuss13 =  w13_long %>%
  mutate(Discussions_PSD = case_when(
  Precinct_discussions_PSD %in% c("No") ~ 0,
  Precinct_discussions_PSD %in% c("Yes") ~ 1,
  TRUE ~ as.double(NA)),
Discussions_PNL = case_when(
  Precinct_discussions_PNL %in% c("No") ~ 0,
  Precinct_discussions_PNL %in% c("Yes") ~ 1,
  TRUE ~ as.double(NA))) %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Discussions_PSD, Discussions_PNL) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  dplyr::summarise(mean = mean(Value, na.rm = T),
            se = se(Value, na.rm = T)) %>%
  filter(!is.na(mean))

discussions = rbind(discuss12, discuss13)
discussions$Wave = c("Panel data (Wave 2)", "Panel data (Wave 2)", "Panel data (Wave 3)", "Panel data (Wave 3)")
discussions$Variable = c("PNL", "PSD", "PNL", "PSD")

discussions %>%
    mutate(Variable = factor(Variable, ordered = TRUE, 
                           levels = c("PSD",  "PNL"),
                           labels = c("PSD",  "PNL")),
         Wave = factor(Wave, ordered = TRUE, 
                       levels = c("Panel data (Wave 3)", "Panel data (Wave 3)", "Panel data (Wave 2)",  "Panel data (Wave 2)"),
                       labels = c("Panel data\n(Wave 3)", "Panel data\n(Wave 3)", "Panel data\n(Wave 2)", "Panel data\n(Wave 2)"))) %>%
  ggplot(aes(x = Wave, y = mean)) +
  geom_col(aes(color = Variable), width = 0.3, fill = "white", size = 2) +  
  geom_errorbar(aes(ymin = mean - 1.96*se, ymax = mean + 1.96*se), width = 0, position=position_dodge(.8), size = 2) +  
  scale_y_continuous(labels = percent, limits = c(0, 1)) +
  labs(x = "", y = "Percentage of USR-PLUS delegates reporting discussions with other parties'\n delegates, by party and panel data waves") +  
  facet_grid(~Variable) +  
  coord_flip() +
  theme_bw()  +
  theme(plot.title = element_text(hjust = 0.5)) +
  theme(text = element_text(size=20)) +
  theme(strip.text.x = element_text(size = 20, face="bold")) +
  theme(strip.text.y = element_text(size = 20, face="bold")) +
  theme(axis.text.x= element_text(size = 20, vjust = 1, hjust = 0.5)) +
  theme(axis.text.y = element_text(size = 20)) +
  theme(axis.title.x= element_text(size = 26)) +
  theme(axis.title.y = element_text(size = 26)) +
  theme(legend.position = "none") +
  scale_color_manual(values = c("red", "blue"))

ggsave("Plots/Figure1_Evidence_contact_discussions.pdf", dpi = 1200, width = 15, height = 7.5, unit = "in")
```

## Figure 2

```{r}

# Thermometer scores

w12_long %>%
  dplyr::filter(Wave == 1) %>%
  dplyr::select(RecipientFirstName, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName), names_to = "Variable", values_to = "Value") %>%
  group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_diff_PSD_leaders",  "Thermo_diff_PSD", "Thermo_diff_PSD_members", "Thermo_diff_PSD_voters", "Thermo_diff_PNL_leaders", "Thermo_diff_PNL", "Thermo_diff_PNL_members", "Thermo_diff_PNL_voters"),
                      labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters", "USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, colour = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(Group)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nThermometer Score (First wave)", x = "") +
  facet_grid(~Group, scales = "free_x") +
  #coord_flip() +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))

ggsave("Plots/Figure2_Thermo_total_w1_main_panel.pdf", dpi = 1200, width = 15, height = 10, unit = "in")

# Best for Romania scores

w12_long %>%
   dplyr::filter(Wave == 1) %>%
  dplyr::select(RecipientFirstName, Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName), names_to = "Variable", values_to = "Value") %>%
  dplyr::group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_diff_PSD_leaders", "Good_diff_PSD", "Good_diff_PSD_members", "Good_diff_PSD_voters", "Good_diff_PNL_leaders",  "Good_diff_PNL", "Good_diff_PNL_members",  "Good_diff_PNL_voters"),
                      labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters", "USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters"))) %>%
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, colour = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(Group)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in the\nBest for Romania variable\n(First wave)", x = "") +
  facet_grid(~Group, scales = "free_x") +
  #coord_flip() +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))

ggsave("Plots/Figure2_Good_total_w1_main_panel.pdf", dpi = 1200, width = 15, height = 10, unit = "in")
```

### T-tests (Panel data, first wave)

```{r}

# Thermometer scores - Affective polarization USR-PLUS - PSD

x = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Thermo_diff_PSD_leaders)
y =  w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Thermo_diff_PSD) 
z = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Thermo_diff_PSD_members)
w = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Thermo_diff_PSD_voters)

t.test(x$Thermo_diff_PSD_leaders, y$Thermo_diff_PSD)

t.test(x$Thermo_diff_PSD_leaders, z$Thermo_diff_PSD_members)

t.test(x$Thermo_diff_PSD_leaders, w$Thermo_diff_PSD_voters)

# Thermometer scores - Affective polarization USR-PLUS - PNL

x = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Thermo_diff_PNL_leaders)
y =  w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Thermo_diff_PNL) 
z = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Thermo_diff_PNL_members)
w = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Thermo_diff_PNL_voters)

t.test(x$Thermo_diff_PNL_leaders, y$Thermo_diff_PNL)

t.test(x$Thermo_diff_PNL_leaders, z$Thermo_diff_PNL_members)

t.test(x$Thermo_diff_PNL_leaders, w$Thermo_diff_PNL_voters)

# Best for Romania scores - Affective polarization USR-PLUS - PSD

x = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Good_diff_PSD_leaders)
y =  w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Good_diff_PSD) 
z = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Good_diff_PSD_members)
w = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Good_diff_PSD_voters)

t.test(x$Good_diff_PSD_leaders, y$Good_diff_PSD)

t.test(x$Good_diff_PSD_leaders, z$Good_diff_PSD_members)

t.test(x$Good_diff_PSD_leaders, w$Good_diff_PSD_voters)

# Best for Romania scores - Affective polarization USR-PLUS - PNL

x = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Good_diff_PNL_leaders)
y =  w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Good_diff_PNL) 
z = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Good_diff_PNL_members)
w = w12_long %>% dplyr::filter(Wave == 1) %>% dplyr::select(Good_diff_PNL_voters)

t.test(x$Good_diff_PNL_leaders, y$Good_diff_PNL)

t.test(x$Good_diff_PNL_leaders, z$Good_diff_PNL_members)

t.test(x$Good_diff_PNL_leaders, w$Good_diff_PNL_voters)
```

## Figure 3

```{r}

# Thermometer scores - Affective polarization USR-PLUS - PSD

w12_wide = w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters) %>%
  pivot_wider(
    id_cols = RecipientFirstName,
    names_from = Wave,
    values_from = c(Delegate_vote_total, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters)) %>%
  mutate(w12_PSD_leaders = Thermo_diff_PSD_leaders_2 - Thermo_diff_PSD_leaders_1,
         w12_PSD = Thermo_diff_PSD_2 - Thermo_diff_PSD_1,
         w12_PSD_members = Thermo_diff_PSD_members_2 - Thermo_diff_PSD_members_1,
         w12_PSD_voters = Thermo_diff_PSD_voters_2 - Thermo_diff_PSD_voters_1)

w12_wide %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total_1, w12_PSD_leaders, w12_PSD, w12_PSD_members, w12_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total_1), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total_1, Variable) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                           levels = c("w12_PSD_leaders",  "w12_PSD", "w12_PSD_members", "w12_PSD_voters"),
                           labels = c("USR-PLUS - PSD\nleaders\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\nmembers and\nsympathizers\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\nvoters\n(Wave 2 - Wave 1)"))) %>%  
  ggplot(aes(x = Variable, y = diff), group = as.factor(Delegate_vote_total_1)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total_1), color = as.factor(Delegate_vote_total_1)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total_1)), position=position_dodge(.2), size = 4) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black", size = 1) +
  labs(y = "Mean Difference in\nThermometer Score\n(Wave 2 - Wave 1)", x = "") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/Figure3_w12_Thermo_PSD_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best for Romania scores - Affective polarization USR-PLUS - PSD

w12_wide1 = w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters) %>%
  pivot_wider(
    id_cols = RecipientFirstName,
    names_from = Wave,
    values_from = c(Delegate_vote_total, Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters)) %>%
  mutate(w12_PSD_leaders = Good_diff_PSD_leaders_2 - Good_diff_PSD_leaders_1,
         w12_PSD = Good_diff_PSD_2 - Good_diff_PSD_1,
         w12_PSD_members = Good_diff_PSD_members_2 - Good_diff_PSD_members_1,
         w12_PSD_voters = Good_diff_PSD_voters_2 - Good_diff_PSD_voters_1)

w12_wide1 %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total_1, w12_PSD_leaders, w12_PSD, w12_PSD_members, w12_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total_1), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total_1, Variable) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                      levels = c("w12_PSD_leaders", "w12_PSD", "w12_PSD_members", "w12_PSD_voters"),
                      labels = c("USR-PLUS - PSD\nleaders\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\nmembers and\nsympathizers\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\nvoters\n(Wave 2 - Wave 1)"))) %>%  
  ggplot(aes(x = Variable, y = diff), group = as.factor(Delegate_vote_total_1)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total_1), color = as.factor(Delegate_vote_total_1)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total_1)), position=position_dodge(.2), size = 4) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black", size = 1) +
  labs(y = "Mean Difference in\nthe Best for Romania variable\n(Wave 2 - Wave 1)", x = "") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/Figure3_w12_Good_PSD_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")
```

## Table 3

```{r}

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_long, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_long, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_long, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_long, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_long, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_long, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_long, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_long, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table 4

```{r}

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_long, Thermo_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_long, Thermo_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_long, Thermo_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_long, Thermo_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_long, Good_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_long, Good_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_long, Good_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_long, Good_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("%stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Figure 4

```{r}

# Thermometer scores

w12_wide = w12_long %>%
  dplyr::select(RecipientFirstName, Wave, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters) %>%
  pivot_wider(
    id_cols = RecipientFirstName,
    names_from = Wave,
    values_from = c(Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters)) %>%
  mutate(w12_PSD_leaders = Thermo_diff_PSD_leaders_2 - Thermo_diff_PSD_leaders_1,
         w12_PSD = Thermo_diff_PSD_2 - Thermo_diff_PSD_1,
         w12_PSD_members = Thermo_diff_PSD_members_2 - Thermo_diff_PSD_members_1,
         w12_PSD_voters = Thermo_diff_PSD_voters_2 - Thermo_diff_PSD_voters_1,
         w12_PNL_leaders = Thermo_diff_PNL_leaders_2 - Thermo_diff_PNL_leaders_1,
         w12_PNL = Thermo_diff_PNL_2 - Thermo_diff_PNL_1,
         w12_PNL_members = Thermo_diff_PNL_members_2 - Thermo_diff_PNL_members_1,
         w12_PNL_voters = Thermo_diff_PNL_voters_2 - Thermo_diff_PNL_voters_1)

w12_wide %>%
  dplyr::select(RecipientFirstName, w12_PSD_leaders, w12_PSD, w12_PSD_members, w12_PSD_voters, w12_PNL_leaders, w12_PNL, w12_PNL_members, w12_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName), names_to = "Variable", values_to = "Value") %>%
  group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("w12_PSD_leaders",  "w12_PSD", "w12_PSD_members", "w12_PSD_voters", "w12_PNL_leaders", "w12_PNL", "w12_PNL_members", "w12_PNL_voters"),
                      labels = c("USR-PLUS - PSD\nleaders\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\nmembers and\nsympathizers\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\nvoters\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\nleaders\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\nmembers and\nsympathizers\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\nvoters\n(Wave 2 - Wave 1)"))) %>%  
  ggplot(aes(x = Variable, y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, color = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Group)), position=position_dodge(.2), size = 4) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black", size = 1) +
  labs(y = "Mean Difference in\nThermometer Score\n(Wave 2 - Wave 1)", x = "") +
  facet_grid(~Group, scales = "free_x") +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))  

ggsave("Plots/Figure4_w12_Thermo_total_uns.pdf", dpi = 1200, width = 15, height = 10, unit = "in")

# Best for Romania scores

w12_wide1 = w12_long %>%
  dplyr::select(RecipientFirstName, Wave, Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters) %>%
  pivot_wider(
    id_cols = RecipientFirstName,
    names_from = Wave,
    values_from = c(Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters)) %>%
  mutate(w12_PSD_leaders = Good_diff_PSD_leaders_2 - Good_diff_PSD_leaders_1,
         w12_PSD = Good_diff_PSD_2 - Good_diff_PSD_1,
         w12_PSD_members = Good_diff_PSD_members_2 - Good_diff_PSD_members_1,
         w12_PSD_voters = Good_diff_PSD_voters_2 - Good_diff_PSD_voters_1,
         w12_PNL_leaders = Good_diff_PNL_leaders_2 - Good_diff_PNL_leaders_1,
         w12_PNL = Good_diff_PNL_2 - Good_diff_PNL_1,
         w12_PNL_members = Good_diff_PNL_members_2 - Good_diff_PNL_members_1,
         w12_PNL_voters = Good_diff_PNL_voters_2 - Good_diff_PNL_voters_1)

w12_wide1 %>%
dplyr::select(RecipientFirstName, w12_PSD_leaders, w12_PSD, w12_PSD_members, w12_PSD_voters, w12_PNL_leaders, w12_PNL, w12_PNL_members, w12_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName), names_to = "Variable", values_to = "Value") %>%
  dplyr::group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("w12_PSD_leaders", "w12_PSD", "w12_PSD_members", "w12_PSD_voters", "w12_PNL_leaders",  "w12_PNL", "w12_PNL_members",  "w12_PNL_voters"),
                      labels = c("USR-PLUS - PSD\nleaders\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\nmembers and\nsympathizers\n(Wave 2 - Wave 1)", "USR-PLUS - PSD\nvoters\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\nleaders\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\nmembers and\nsympathizers\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\nvoters\n(Wave 2 - Wave 1)"))) %>%  
    ggplot(aes(x = Variable, y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, color = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Group)), position=position_dodge(.2), size = 4) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black", size = 1) +
  labs(y = "Mean Difference in\nthe Best for Romania variable\n(Wave 2 - Wave 1)", x = "") +
  facet_grid(~Group, scales = "free_x") +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))

ggsave("Plots/Figure4_w12_Good_total_uns.pdf", dpi = 1200, width = 15, height = 10, unit = "in")
```

## Figure 5

```{r}

# Thermometer scores - Affective polarization USR-PLUS - PSD

w13_wide = w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters) %>%
  pivot_wider(
    id_cols = RecipientFirstName,
    names_from = Wave,
    values_from = c(Delegate_vote_total, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters)) %>%
  mutate(w13_PSD_leaders = Thermo_diff_PSD_leaders_3 - Thermo_diff_PSD_leaders_1,
         w13_PSD = Thermo_diff_PSD_3 - Thermo_diff_PSD_1,
         w13_PSD_members = Thermo_diff_PSD_members_3 - Thermo_diff_PSD_members_1,
         w13_PSD_voters = Thermo_diff_PSD_voters_3 - Thermo_diff_PSD_voters_1)

w13_wide %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total_1, w13_PSD_leaders, w13_PSD, w13_PSD_members, w13_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total_1), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total_1, Variable) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                           levels = c("w13_PSD_leaders",  "w13_PSD", "w13_PSD_members", "w13_PSD_voters"),
                           labels = c("USR-PLUS - PSD\nleaders\n(Wave 3 - Wave 1)", "USR-PLUS - PSD\n(Wave 3 - Wave 1)", "USR-PLUS - PSD\nmembers and\nsympathizers\n(Wave 3 - Wave 1)", "USR-PLUS - PSD\nvoters\n(Wave 3 - Wave 1)"))) %>%  
  ggplot(aes(x = Variable, y = diff), group = as.factor(Delegate_vote_total_1)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total_1), color = as.factor(Delegate_vote_total_1)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total_1)), position=position_dodge(.2), size = 4) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black", size = 1) +
  labs(y = "Mean Difference in\nThermometer Score\n(Wave 3 - Wave 1)", x = "") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/Figure5_w13_Thermo_PSD_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best for Romania scores - Affective polarization USR-PLUS - PSD

w13_wide1 = w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters) %>%
  pivot_wider(
    id_cols = RecipientFirstName,
    names_from = Wave,
    values_from = c(Delegate_vote_total, Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters)) %>%
  mutate(w13_PSD_leaders = Good_diff_PSD_leaders_3 - Good_diff_PSD_leaders_1,
         w13_PSD = Good_diff_PSD_3 - Good_diff_PSD_1,
         w13_PSD_members = Good_diff_PSD_members_3 - Good_diff_PSD_members_1,
         w13_PSD_voters = Good_diff_PSD_voters_3 - Good_diff_PSD_voters_1)

w13_wide1 %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total_1, w13_PSD_leaders, w13_PSD, w13_PSD_members, w13_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total_1), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total_1, Variable) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                      levels = c("w13_PSD_leaders", "w13_PSD", "w13_PSD_members", "w13_PSD_voters"),
                      labels = c("USR-PLUS - PSD\nleaders\n(Wave 3 - Wave 1)", "USR-PLUS - PSD\n(Wave 3 - Wave 1)", "USR-PLUS - PSD\nmembers and\nsympathizers\n(Wave 3 - Wave 1)", "USR-PLUS - PSD\nvoters\n(Wave 3 - Wave 1)"))) %>%  
  ggplot(aes(x = Variable, y = diff), group = as.factor(Delegate_vote_total_1)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total_1), color = as.factor(Delegate_vote_total_1)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total_1)), position=position_dodge(.2), size = 4) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black", size = 1) +
  labs(y = "Mean Difference in\nthe Best for Romania variable\n(Wave 3 - Wave 1)", x = "") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/Figure5_w13_Good_PSD_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")
```

## Table 5

```{r}

models_psd13 = list()

models_psd13[[1]] = felm(data = w13_long, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[2]] = felm(data = w13_long, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[3]] = felm(data = w13_long, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[4]] = felm(data = w13_long, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[5]] = felm(data = w13_long, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[6]] = felm(data = w13_long, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[7]] = felm(data = w13_long, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[8]] = felm(data = w13_long, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Political assessments (Wave 3)

```{r}

# Evaluation of the government formation (0 - 4 scale)

## Total sample
w13_long %>%
  dplyr::select(Evaluation_gov_formation, Wave) %>%
  filter(Wave != 1) %>%
  group_by( Wave) %>%
  dplyr::summarise(mean = mean(Evaluation_gov_formation, na.rm = T))

## Delegates vs. non-delegates
w13_long %>%
  dplyr::select(Evaluation_gov_formation, Delegate_vote_total, Wave) %>%
  filter(Wave != 1) %>%
  group_by(Delegate_vote_total, Wave) %>%
  dplyr::summarise(mean = mean(Evaluation_gov_formation, na.rm = T)) %>%
  filter(!is.na(Delegate_vote_total))

# Evaluation of the activity of the government (0 - 4 scale)

## Total sample
w13_long %>%
  dplyr::select(Evaluation_activity_gov, Wave) %>%
  filter(Wave != 1) %>%
  group_by( Wave) %>%
  dplyr::summarise(mean = mean(Evaluation_activity_gov, na.rm = T))

## Delegates vs. non-delegates
w13_long %>%
  dplyr::select(Evaluation_activity_gov, Delegate_vote_total, Wave) %>%
  filter(Wave != 1) %>%
  group_by(Delegate_vote_total, Wave) %>%
  dplyr::summarise(mean = mean(Evaluation_activity_gov, na.rm = T)) %>%
  filter(!is.na(Delegate_vote_total))

# Evaluation of the implementation of the COVID-19 vaccination campaign (0 - 10 scale)

## Total sample
w13_long %>%
  dplyr::select(Evaluation_vaccination_campaign, Wave) %>%
  filter(Wave != 1) %>%
  group_by( Wave) %>%
  dplyr::summarise(mean = mean(Evaluation_vaccination_campaign, na.rm = T))

## Delegates vs. non-delegates
w13_long %>%
  dplyr::select(Evaluation_vaccination_campaign, Delegate_vote_total, Wave) %>%
  filter(Wave != 1) %>%
  group_by(Delegate_vote_total, Wave) %>%
  dplyr::summarise(mean = mean(Evaluation_vaccination_campaign, na.rm = T)) %>%
  filter(!is.na(Delegate_vote_total))
```

# Online Appendix

## Data prep and merge - cross-sectional data

```{r}

# Wave 1 dataset - cross-sectional
data1 = wave1_usrplus %>% dplyr::select(ID, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters,  Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters, Thermo_PSD_leaders, Thermo_PSD, Thermo_PSD_members, Thermo_PSD_voters, Thermo_PNL_leaders, Thermo_PNL, Thermo_PNL_members, Thermo_PNL_voters,  Good_PSD_leaders, Good_PSD, Good_PSD_members, Good_PSD_voters, Good_PNL_leaders, Good_PNL, Good_PNL_members, Good_PNL_voters, Delegate_vote_total, Identity_USRPLUS, Age, Female, Education, Urban, Ethnicity, Marital_status, Income_objective, Income_subjective, Political_efficacy, Ideology, Political_news) %>% mutate(Wave = 1, 
      Period = 0,
      University_ed = ifelse(Education %in% c("Graduate studies", "University"), 1, 0),
      Romanian = ifelse(Ethnicity %in% c("Romanian"), 1, 0),
      Married = ifelse(Marital_status %in% c("Married"), 1, 0),
      Over_10k = ifelse(Income_objective %in% c("Over 10000 lei"), 1, 0),
      Well_off = ifelse(Income_subjective %in% c("Everything we want", "Live well"), 1, 0))

# Wave 2 dataset - cross-sectional
data2 = wave2_usrplus %>% dplyr::select(ID, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters,  Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters, Thermo_PSD_leaders, Thermo_PSD, Thermo_PSD_members, Thermo_PSD_voters, Thermo_PNL_leaders, Thermo_PNL, Thermo_PNL_members, Thermo_PNL_voters,  Good_PSD_leaders, Good_PSD, Good_PSD_members, Good_PSD_voters, Good_PNL_leaders, Good_PNL, Good_PNL_members, Good_PNL_voters, Delegate_vote_total, Identity_USRPLUS, Age, Female, Education, Urban, Ethnicity, Marital_status, Income_objective, Income_subjective, Political_efficacy, Ideology, Political_news) %>% mutate(Wave = 2, Period = 1,
      University_ed = ifelse(Education %in% c("Graduate studies", "University"), 1, 0),
      Romanian = ifelse(Ethnicity %in% c("Romanian"), 1, 0),
      Married = ifelse(Marital_status %in% c("Married"), 1, 0),
      Over_10k = ifelse(Income_objective %in% c("Over 10000 lei"), 1, 0),
      Well_off = ifelse(Income_subjective %in% c("Everything we want", "Live well"), 1, 0))

# Wave 3 dataset - cross-sectional
data3 = wave3_usrplus %>% dplyr::select(ID, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters,  Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters, Thermo_PSD_leaders, Thermo_PSD, Thermo_PSD_members, Thermo_PSD_voters, Thermo_PNL_leaders, Thermo_PNL, Thermo_PNL_members, Thermo_PNL_voters,  Good_PSD_leaders, Good_PSD, Good_PSD_members, Good_PSD_voters, Good_PNL_leaders, Good_PNL, Good_PNL_members, Good_PNL_voters, Delegate_vote_total, Identity_USRPLUS, Age, Female, Education, Urban, Ethnicity, Marital_status, Income_objective, Income_subjective, Political_efficacy, Ideology, Political_news) %>% mutate(Wave = 3, Period = 1,
      University_ed = ifelse(Education %in% c("Graduate studies", "University"), 1, 0),
      Romanian = ifelse(Ethnicity %in% c("Romanian"), 1, 0),
      Married = ifelse(Marital_status %in% c("Married"), 1, 0),
      Over_10k = ifelse(Income_objective %in% c("Over 10000 lei"), 1, 0),
      Well_off = ifelse(Income_subjective %in% c("Everything we want", "Live well"), 1, 0))

# Final cross-sectional datasets (waves 1 and 2; waves 1 and 3)
data12 <- do.call("rbind", list(data1, data2))
data13 <- do.call("rbind", list(data1, data3))
```

### Standardize DVs - waves 1 and 2 (w12)

```{r}

# Affective polarization (difference) USR-PLUS vs. PSD

data12$Thermo_diff_PSD_leaders_s = (data12$Thermo_diff_PSD_leaders - mean(data12$Thermo_diff_PSD_leaders, na.rm = T))/sd(data12$Thermo_diff_PSD_leaders, na.rm = T)

data12$Thermo_diff_PSD_s = (data12$Thermo_diff_PSD - mean(data12$Thermo_diff_PSD, na.rm = T))/sd(data12$Thermo_diff_PSD, na.rm = T)

data12$Thermo_diff_PSD_members_s = (data12$Thermo_diff_PSD_members - mean(data12$Thermo_diff_PSD_members, na.rm = T))/sd(data12$Thermo_diff_PSD_members, na.rm = T)

data12$Thermo_diff_PSD_voters_s = (data12$Thermo_diff_PSD_voters - mean(data12$Thermo_diff_PSD_voters, na.rm = T))/sd(data12$Thermo_diff_PSD_voters, na.rm = T)


data12$Good_diff_PSD_leaders_s = (data12$Good_diff_PSD_leaders - mean(data12$Good_diff_PSD_leaders, na.rm = T))/sd(data12$Good_diff_PSD_leaders, na.rm = T)

data12$Good_diff_PSD_s = (data12$Good_diff_PSD - mean(data12$Good_diff_PSD, na.rm = T))/sd(data12$Good_diff_PSD, na.rm = T)

data12$Good_diff_PSD_members_s = (data12$Good_diff_PSD_members - mean(data12$Good_diff_PSD_members, na.rm = T))/sd(data12$Good_diff_PSD_members, na.rm = T)

data12$Good_diff_PSD_voters_s = (data12$Good_diff_PSD_voters - mean(data12$Good_diff_PSD_voters, na.rm = T))/sd(data12$Good_diff_PSD_voters, na.rm = T)


# Affective polarization (difference) USR-PLUS vs. PNL

data12$Thermo_diff_PNL_leaders_s = (data12$Thermo_diff_PNL_leaders - mean(data12$Thermo_diff_PNL_leaders, na.rm = T))/sd(data12$Thermo_diff_PNL_leaders, na.rm = T)

data12$Thermo_diff_PNL_s = (data12$Thermo_diff_PNL - mean(data12$Thermo_diff_PNL, na.rm = T))/sd(data12$Thermo_diff_PNL, na.rm = T)

data12$Thermo_diff_PNL_members_s = (data12$Thermo_diff_PNL_members - mean(data12$Thermo_diff_PNL_members, na.rm = T))/sd(data12$Thermo_diff_PNL_members, na.rm = T)

data12$Thermo_diff_PNL_voters_s = (data12$Thermo_diff_PNL_voters - mean(data12$Thermo_diff_PNL_voters, na.rm = T))/sd(data12$Thermo_diff_PNL_voters, na.rm = T)


data12$Good_diff_PNL_leaders_s = (data12$Good_diff_PNL_leaders - mean(data12$Good_diff_PNL_leaders, na.rm = T))/sd(data12$Good_diff_PNL_leaders, na.rm = T)

data12$Good_diff_PNL_s = (data12$Good_diff_PNL - mean(data12$Good_diff_PNL, na.rm = T))/sd(data12$Good_diff_PNL, na.rm = T)

data12$Good_diff_PNL_members_s = (data12$Good_diff_PNL_members - mean(data12$Good_diff_PNL_members, na.rm = T))/sd(data12$Good_diff_PNL_members, na.rm = T)

data12$Good_diff_PNL_voters_s = (data12$Good_diff_PNL_voters - mean(data12$Good_diff_PNL_voters, na.rm = T))/sd(data12$Good_diff_PNL_voters, na.rm = T)


# PSD scores

data12$Thermo_PSD_leaders_s = (data12$Thermo_PSD_leaders - mean(data12$Thermo_PSD_leaders, na.rm = T))/sd(data12$Thermo_PSD_leaders, na.rm = T)

data12$Thermo_PSD_s = (data12$Thermo_PSD - mean(data12$Thermo_PSD, na.rm = T))/sd(data12$Thermo_PSD, na.rm = T)

data12$Thermo_PSD_members_s = (data12$Thermo_PSD_members - mean(data12$Thermo_PSD_members, na.rm = T))/sd(data12$Thermo_PSD_members, na.rm = T)

data12$Thermo_PSD_voters_s = (data12$Thermo_PSD_voters - mean(data12$Thermo_PSD_voters, na.rm = T))/sd(data12$Thermo_PSD_voters, na.rm = T)


data12$Good_PSD_leaders_s = (data12$Good_PSD_leaders - mean(data12$Good_PSD_leaders, na.rm = T))/sd(data12$Good_PSD_leaders, na.rm = T)

data12$Good_PSD_s = (data12$Good_PSD - mean(data12$Good_PSD, na.rm = T))/sd(data12$Good_PSD, na.rm = T)

data12$Good_PSD_members_s = (data12$Good_PSD_members - mean(data12$Good_PSD_members, na.rm = T))/sd(data12$Good_PSD_members, na.rm = T)

data12$Good_PSD_voters_s = (data12$Good_PSD_voters - mean(data12$Good_PSD_voters, na.rm = T))/sd(data12$Good_PSD_voters, na.rm = T)


# PNL scores

data12$Thermo_PNL_leaders_s = (data12$Thermo_PNL_leaders - mean(data12$Thermo_PNL_leaders, na.rm = T))/sd(data12$Thermo_PNL_leaders, na.rm = T)

data12$Thermo_PNL_s = (data12$Thermo_PNL - mean(data12$Thermo_PNL, na.rm = T))/sd(data12$Thermo_PNL, na.rm = T)

data12$Thermo_PNL_members_s = (data12$Thermo_PNL_members - mean(data12$Thermo_PNL_members, na.rm = T))/sd(data12$Thermo_PNL_members, na.rm = T)

data12$Thermo_PNL_voters_s = (data12$Thermo_PNL_voters - mean(data12$Thermo_PNL_voters, na.rm = T))/sd(data12$Thermo_PNL_voters, na.rm = T)


data12$Good_PNL_leaders_s = (data12$Good_PNL_leaders - mean(data12$Good_PNL_leaders, na.rm = T))/sd(data12$Good_PNL_leaders, na.rm = T)

data12$Good_PNL_s = (data12$Good_PNL - mean(data12$Good_PNL, na.rm = T))/sd(data12$Good_PNL, na.rm = T)

data12$Good_PNL_members_s = (data12$Good_PNL_members - mean(data12$Good_PNL_members, na.rm = T))/sd(data12$Good_PNL_members, na.rm = T)

data12$Good_PNL_voters_s = (data12$Good_PNL_voters - mean(data12$Good_PNL_voters, na.rm = T))/sd(data12$Good_PNL_voters, na.rm = T)


# Social identity - USR-PLUS

data12$Identity_USRPLUS_s = (data12$Identity_USRPLUS - mean(data12$Identity_USRPLUS, na.rm = T))/sd(data12$Identity_USRPLUS, na.rm = T)
```

### Standardize DVs - waves 1 and 3 (w13)

```{r}

# Affective polarization (difference) USR-PLUS vs. PSD

data13$Thermo_diff_PSD_leaders_s = (data13$Thermo_diff_PSD_leaders - mean(data13$Thermo_diff_PSD_leaders, na.rm = T))/sd(data13$Thermo_diff_PSD_leaders, na.rm = T)

data13$Thermo_diff_PSD_s = (data13$Thermo_diff_PSD - mean(data13$Thermo_diff_PSD, na.rm = T))/sd(data13$Thermo_diff_PSD, na.rm = T)

data13$Thermo_diff_PSD_members_s = (data13$Thermo_diff_PSD_members - mean(data13$Thermo_diff_PSD_members, na.rm = T))/sd(data13$Thermo_diff_PSD_members, na.rm = T)

data13$Thermo_diff_PSD_voters_s = (data13$Thermo_diff_PSD_voters - mean(data13$Thermo_diff_PSD_voters, na.rm = T))/sd(data13$Thermo_diff_PSD_voters, na.rm = T)


data13$Good_diff_PSD_leaders_s = (data13$Good_diff_PSD_leaders - mean(data13$Good_diff_PSD_leaders, na.rm = T))/sd(data13$Good_diff_PSD_leaders, na.rm = T)

data13$Good_diff_PSD_s = (data13$Good_diff_PSD - mean(data13$Good_diff_PSD, na.rm = T))/sd(data13$Good_diff_PSD, na.rm = T)

data13$Good_diff_PSD_members_s = (data13$Good_diff_PSD_members - mean(data13$Good_diff_PSD_members, na.rm = T))/sd(data13$Good_diff_PSD_members, na.rm = T)

data13$Good_diff_PSD_voters_s = (data13$Good_diff_PSD_voters - mean(data13$Good_diff_PSD_voters, na.rm = T))/sd(data13$Good_diff_PSD_voters, na.rm = T)


# Affective polarization (difference) USR-PLUS vs. PNL

data13$Thermo_diff_PNL_leaders_s = (data13$Thermo_diff_PNL_leaders - mean(data13$Thermo_diff_PNL_leaders, na.rm = T))/sd(data13$Thermo_diff_PNL_leaders, na.rm = T)

data13$Thermo_diff_PNL_s = (data13$Thermo_diff_PNL - mean(data13$Thermo_diff_PNL, na.rm = T))/sd(data13$Thermo_diff_PNL, na.rm = T)

data13$Thermo_diff_PNL_members_s = (data13$Thermo_diff_PNL_members - mean(data13$Thermo_diff_PNL_members, na.rm = T))/sd(data13$Thermo_diff_PNL_members, na.rm = T)

data13$Thermo_diff_PNL_voters_s = (data13$Thermo_diff_PNL_voters - mean(data13$Thermo_diff_PNL_voters, na.rm = T))/sd(data13$Thermo_diff_PNL_voters, na.rm = T)


data13$Good_diff_PNL_leaders_s = (data13$Good_diff_PNL_leaders - mean(data13$Good_diff_PNL_leaders, na.rm = T))/sd(data13$Good_diff_PNL_leaders, na.rm = T)

data13$Good_diff_PNL_s = (data13$Good_diff_PNL - mean(data13$Good_diff_PNL, na.rm = T))/sd(data13$Good_diff_PNL, na.rm = T)

data13$Good_diff_PNL_members_s = (data13$Good_diff_PNL_members - mean(data13$Good_diff_PNL_members, na.rm = T))/sd(data13$Good_diff_PNL_members, na.rm = T)

data13$Good_diff_PNL_voters_s = (data13$Good_diff_PNL_voters - mean(data13$Good_diff_PNL_voters, na.rm = T))/sd(data13$Good_diff_PNL_voters, na.rm = T)


# PSD scores

data13$Thermo_PSD_leaders_s = (data13$Thermo_PSD_leaders - mean(data13$Thermo_PSD_leaders, na.rm = T))/sd(data13$Thermo_PSD_leaders, na.rm = T)

data13$Thermo_PSD_s = (data13$Thermo_PSD - mean(data13$Thermo_PSD, na.rm = T))/sd(data13$Thermo_PSD, na.rm = T)

data13$Thermo_PSD_members_s = (data13$Thermo_PSD_members - mean(data13$Thermo_PSD_members, na.rm = T))/sd(data13$Thermo_PSD_members, na.rm = T)

data13$Thermo_PSD_voters_s = (data13$Thermo_PSD_voters - mean(data13$Thermo_PSD_voters, na.rm = T))/sd(data13$Thermo_PSD_voters, na.rm = T)


data13$Good_PSD_leaders_s = (data13$Good_PSD_leaders - mean(data13$Good_PSD_leaders, na.rm = T))/sd(data13$Good_PSD_leaders, na.rm = T)

data13$Good_PSD_s = (data13$Good_PSD - mean(data13$Good_PSD, na.rm = T))/sd(data13$Good_PSD, na.rm = T)

data13$Good_PSD_members_s = (data13$Good_PSD_members - mean(data13$Good_PSD_members, na.rm = T))/sd(data13$Good_PSD_members, na.rm = T)

data13$Good_PSD_voters_s = (data13$Good_PSD_voters - mean(data13$Good_PSD_voters, na.rm = T))/sd(data13$Good_PSD_voters, na.rm = T)


# PNL scores

data13$Thermo_PNL_leaders_s = (data13$Thermo_PNL_leaders - mean(data13$Thermo_PNL_leaders, na.rm = T))/sd(data13$Thermo_PNL_leaders, na.rm = T)

data13$Thermo_PNL_s = (data13$Thermo_PNL - mean(data13$Thermo_PNL, na.rm = T))/sd(data13$Thermo_PNL, na.rm = T)

data13$Thermo_PNL_members_s = (data13$Thermo_PNL_members - mean(data13$Thermo_PNL_members, na.rm = T))/sd(data13$Thermo_PNL_members, na.rm = T)

data13$Thermo_PNL_voters_s = (data13$Thermo_PNL_voters - mean(data13$Thermo_PNL_voters, na.rm = T))/sd(data13$Thermo_PNL_voters, na.rm = T)


data13$Good_PNL_leaders_s = (data13$Good_PNL_leaders - mean(data13$Good_PNL_leaders, na.rm = T))/sd(data13$Good_PNL_leaders, na.rm = T)

data13$Good_PNL_s = (data13$Good_PNL - mean(data13$Good_PNL, na.rm = T))/sd(data13$Good_PNL, na.rm = T)

data13$Good_PNL_members_s = (data13$Good_PNL_members - mean(data13$Good_PNL_members, na.rm = T))/sd(data13$Good_PNL_members, na.rm = T)

data13$Good_PNL_voters_s = (data13$Good_PNL_voters - mean(data13$Good_PNL_voters, na.rm = T))/sd(data13$Good_PNL_voters, na.rm = T)


# Social identity - USR-PLUS

data13$Identity_USRPLUS_s = (data13$Identity_USRPLUS - mean(data13$Identity_USRPLUS, na.rm = T))/sd(data13$Identity_USRPLUS, na.rm = T)
```

## Hartman and Hidalgo (2018) functions

```{r}

library(Hmisc)
library(sna)
library(gridExtra)
library(grDevices)
library(sandwich)
library(reshape2)
library(parallel)
library(xtable)
# library(Cairo)

####

equiv.t.test <- function(x, y, alpha = .05, epsilon = .2, std.err = "nominal", cluster.x = NULL, cluster.y = NULL) {
  x = x[!is.na(x)]
  y = y[!is.na(y)]
  
  
  dbar <- mean(x) - mean(y)
  m <- as.double(length(x))
  n <- as.double(length(y))
  N <- m+n
  x.var <-  var(x)
  y.var <- var(y)
  non.cent <- (m*n*epsilon^2)/N
  critical.const <- sqrt(qf(alpha,1,N-2,non.cent))
  
  se = sqrt((m-1)*x.var + (n-1)*y.var) / sqrt(m*n * (N-2)/N)
  df = N - 2
  
  t.stat <-  dbar / se
  p = pf(abs(t.stat)^2, 1, df , non.cent)
  obs_smd = (mean(x) - mean(y)) / sd(y)
  inverted <- try(uniroot(function(x) pf(abs(t.stat)^2, 1, N-2, ncp = (m*n*x^2)/N) - ifelse(pf(abs(t.stat)^2, 1, N-2, ncp = (m*n*0^2)/N) < alpha, pf(abs(t.stat)^2, 1, N-2, ncp = (m*n*obs_smd^2)/N), alpha), c(0,10*abs(t.stat)), tol = 0.0001)$root, silent = TRUE)
  if(class(inverted) == "try-error") {
    inverted = NA
  }
  rej = abs(t.stat) <= critical.const
  return(list(t.stat = t.stat, critical.const = critical.const, power = 2*pt(critical.const, N-2)-1, rej = rej, p = p, inverted = inverted))
}

#####

run_equiv = function(X, Tr, epsilon.method = "std.effect", Y = NULL, 
                     custom.epsilon = NULL, std.err = "nominal", type = "equiv.t.test", 
                     fdr_correct = FALSE, cluster.x = NULL, cluster.y = NULL) {
  switch(epsilon.method,
         std.effect = {
           tol = abs(mean(Y[Tr == 1], na.rm = TRUE) - mean(Y[Tr == 0], na.rm = TRUE)) / sd(Y[Tr == 0], na.rm = TRUE)
         }, 
         custom = {
           if(is.null(custom.epsilon)) stop("ERROR: Must enter a custom epsilon value to use the 'custom' epsilon.method.")
           tol = custom.epsilon
         },
         strict = {
           tol = 0.36
         }, 
         liberal = {
           tol = 0.74
         }, 
         stop("ERROR: 'epsilon.method' not set to a valid option")
  )
  
  ranges = rep(tol, ncol(X))
  names(ranges) = names(X)
  print(ranges)
  
  # conduct equiv test for each variable
  tests = do.call("rbind", lapply(names(X), function(var) {
    print(var)
    
    res = equiv.t.test(X[Tr == 1, var], X[Tr == 0, var], epsilon = ranges[var], std.err = std.err, cluster.x = cluster.x, cluster.y = cluster.y)
    res$stat = res$t.stat
    res$obs_diff = (mean(X[Tr == 1, var], na.rm = TRUE) - mean(X[Tr == 0, var], na.rm = TRUE))
    res$obs_smd = ((mean(X[Tr == 1, var], na.rm = TRUE) - mean(X[Tr == 0, var], na.rm = TRUE))) / sd(X[Tr == 0, var], na.rm = TRUE)
    res$sd = sd(X[Tr == 0, var], na.rm = TRUE)
      
      return(c(res$inverted
               , round(res$p, 4)
               , res$obs_smd
               , res$obs_diff
               , res$power
               , res$sd))
    
  }))
  
  p.vals = unlist(tests[,2])
  names(p.vals) = names(ranges)
  
  power = unlist(tests[,5])
  names(power) = names(ranges)
  
  inverted = unlist(tests[,1])
  names(inverted) = names(ranges)
  
  sd = unlist(tests[,6])
  names(sd) = names(ranges)
  
  # return to scale of var
  inverted.scaled = unlist(lapply(names(inverted), function(var) {
    return(inverted[var] * sd[var])
  }))
  names(inverted.scaled) = names(ranges)
  
  observed.smd = unlist(tests[,3])
  names(observed.smd) = names(ranges)
  
  observed.diff = unlist(tests[,4])
  names(observed.diff) = names(ranges)
  
  # conduct BH FDR adjustment
  if(fdr_correct) {
    p.vals = p.adjust(p.vals, method = "BH")  
  }
  
  return(list(tol = ranges, inverted = inverted, inverted.scaled = inverted.scaled, p.vals = p.vals, observed.diff = observed.diff, observed.smd = observed.smd, power = power))
}

## a helper function to generate the plot
generate_plot = function(equiv_tests, panel.widths=c(1, 1, 5, 1, 1), display.names = NULL, var.rounding = 1, pval.rounding = 2, fdr_correct = FALSE) {
  .e <- environment()
  if(!is.null(display.names)) {
    equiv_tests$names = factor(display.names, levels = rev(display.names))
  } else {
    equiv_tests$names = factor(row.names(equiv_tests), levels = rev(row.names(equiv_tests)))
  }
  equiv_tests$const = rep(1, nrow(equiv_tests))
  equiv_tests = equiv_tests[nrow(equiv_tests):1, ]
  
  g = ggplot(equiv_tests, aes(x = names) )
  print(length(unique(equiv_tests$tol)))
  g = g + geom_linerange(aes(ymin = -1 * inverted, ymax = inverted), size = 5, color = "darkgray", alpha = 0.9)
  if(length(unique(equiv_tests$tol)) > 1){
    g = g + geom_linerange(aes(ymin = -1 * tol, ymax = tol), size = 10, color = 'gray')   
  } else {
    print("here")
    print(unique(equiv_tests$tol))
    lines = unique(equiv_tests$tol)
    g = g + geom_hline(yintercept = c(-1 * lines, lines), linetype = 2, size = 0.75)
  }
  g = g  + scale_shape_identity() + geom_point(aes(y = observed.smd), color = "black", shape = 18, size = 4)
  g = (g + coord_flip()
       + theme(
         axis.text.y = element_blank()
         , axis.ticks.y = element_blank()
         , axis.title.y = element_blank()
         , axis.text.x = element_text(size = 14)
         , axis.title.x = element_text(size = 14))
       + labs(x=NULL, y = paste("Equivalence Range (in standard deviations \u03C3)"), font=5) + theme_bw()
  )
  if(length(unique(equiv_tests$tol)) == 1) {
    g = g + ggtitle(paste0("Equivalence Tests  \n \n", "Equivalence Range: +/- ", round(unique(equiv_tests$tol), 2), "\u03C3 \n"))
  } else {
    g = g + ggtitle("Equivalence Tests  \n \n \n")
  }
  
  g_inv = ggplot(equiv_tests, aes(x = names, y = const, label = round(inverted.scaled, var.rounding)), environment = .e)
  g_inv = g_inv + geom_text()
  g_inv = (g_inv + theme_bw() + coord_flip()
           + theme(panel.grid.minor=element_blank()
                   , panel.grid.major=element_blank()
                   #, axis.line.x = element_blank()
                   , axis.text.x = element_text(color = "white", size = 14)
                   , axis.ticks.x = element_line(color = "white")
                   , axis.text.y = element_blank()
                   , axis.ticks.y = element_blank()
                   , axis.title.x = element_text(size = 14)
           )
           + ylim(1-.05, 1.05)
           + ggtitle("Equivalence\nConfidence\nInterval (+/-)\n(Scale of Var)")
           + labs(y = " ", x = NULL)
  )
  
  g_obs = ggplot(equiv_tests, aes(x = names, y = const, label = round(observed.diff, var.rounding)), environment = .e)
  g_obs = g_obs + geom_text()
  g_obs = (g_obs + theme_bw() + coord_flip()
           + theme(panel.grid.minor=element_blank()
                   , panel.grid.major=element_blank()
                   #, axis.line.x = element_blank()
                   , axis.text.x = element_text(color = "white", size = 14)
                   , axis.ticks.x = element_line(color = "white")
                   , axis.text.y = element_blank()
                   , axis.ticks.y = element_blank()
                   , axis.title.x = element_text(size = 14)
           )
           + ylim(1-.05, 1.05)
           + ggtitle("Observed\nMean\nDifference\n(Scale of Var)")
           + labs(y = " ", x = NULL)
  )
  
  g_pval = ggplot(equiv_tests, aes(x = names, y = const, label = round(p.vals, pval.rounding)), environment = .e)
  g_pval = g_pval + geom_text()
  g_pval = (g_pval + theme_bw() + coord_flip()
            + theme(panel.grid.minor=element_blank()
                    , panel.grid.major=element_blank()
                    #, axis.line.x = element_blank()
                    , axis.text.x = element_text(color = "white", size = 14)
                    , axis.ticks.x = element_line(color = "white")
                    , axis.text.y = element_blank()
                    , axis.ticks.y = element_blank()
                    , axis.title.x = element_text(size = 14)
            )
            + ylim(1-.05, 1.05)
            + ggtitle(ifelse(fdr_correct, "\nFDR\nCorrected\nP-value", "\n\n\nP-value"))
            + labs(y = " ", x = NULL)
  )
  
  g_var = ggplot(equiv_tests, aes(x = names, y = const, label = names))
  g_var = g_var + geom_text()
  g_var = (g_var + theme_bw() + coord_flip()
           + theme(panel.grid.minor=element_blank()
                   , panel.grid.major=element_blank()
                   #, axis.line.x = element_blank()
                   , axis.text.x = element_text(color = "white", size = 14)
                   , axis.ticks.x = element_line(color = "white")
                   , axis.text.y = element_blank()
                   , axis.ticks.y = element_blank()
                   , panel.border = element_blank()
                   , axis.title.x = element_text(size = 14)
           )
           + ylim(1-.05, 1.05)
           + ggtitle("\n \n \nVariable") + theme(plot.title = element_text(hjust = 0.5))
           + labs(y = " ", x = NULL)
  )
  
  grid.arrange(g_var, g_obs, g, g_inv, g_pval, ncol=5, nrow=1, widths= panel.widths, heights=c(4))
}
```

## Figure A.1

```{r}

# Thermometer scores

## Activists

data3 %>%
  dplyr::select(ID, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters) %>%
  pivot_longer(-c(ID), names_to = "Variable", values_to = "Value") %>%
  group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_diff_PSD_leaders",  "Thermo_diff_PSD", "Thermo_diff_PSD_members", "Thermo_diff_PSD_voters", "Thermo_diff_PNL_leaders", "Thermo_diff_PNL", "Thermo_diff_PNL_members", "Thermo_diff_PNL_voters"),
                      labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters", "USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, colour = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(Group)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in Thermometer Score\nUSR-PLUS activists\n(January - February 2021)", x = "") +
  scale_y_continuous(breaks = seq(0, 80, 10), limits = c(0, 80)) +
  facet_grid(~Group, scales = "free_x") +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))

ggsave("Plots/FigureA1_activists_Thermo_total_w3_main.pdf", dpi = 1200, width = 10, height = 10, unit = "in")

## Voters

voters_usrplus <- readRDS("USRPLUS_voters.RDS")

voters_usrplus %>%
  dplyr::select(ID, PSD_leaders_termo, PSD_termo, PSD_members_termo, PSD_voters_termo, PNL_leaders_termo, PNL_termo, PNL_members_termo, PNL_voters_termo, USRPLUS_leaders_termo, USRPLUS_termo, USRPLUS_members_termo, USRPLUS_voters_termo) %>%
  mutate(diff_psd_leaders = USRPLUS_leaders_termo - PSD_leaders_termo,
         diff_psd = USRPLUS_termo - PSD_termo,
         diff_psd_members = USRPLUS_members_termo - PSD_members_termo,
         diff_psd_voters = USRPLUS_voters_termo - PSD_voters_termo,
         diff_pnl_leaders = USRPLUS_leaders_termo - PNL_leaders_termo,
         diff_pnl = USRPLUS_termo - PNL_termo,
         diff_pnl_members = USRPLUS_members_termo - PNL_members_termo,
         diff_pnl_voters = USRPLUS_voters_termo - PNL_voters_termo) %>%
  dplyr::select(ID, diff_psd_leaders, diff_psd, diff_psd_members, diff_psd_voters, diff_pnl_leaders, diff_pnl, diff_pnl_members, diff_pnl_voters) %>%
  pivot_longer(-ID, names_to = "Variable", values_to = "Value") %>% 
  group_by(Variable) %>% 
  dplyr::summarise(mean = mean(Value, na.rm = T),
            se = se(Value, na.rm = T)) %>%
  mutate(group = rep(1:2, each = 4),
             group = factor(group, ordered = TRUE, 
                   levels = c("2",  "1"),
                   labels = c("PSD",  "PNL")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("diff_psd_leaders",  "diff_psd", "diff_psd_members", "diff_psd_voters", "diff_pnl_leaders", "diff_pnl", "diff_pnl_members", "diff_pnl_voters"),
                      labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters", "USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters"))) %>%
  ggplot(aes(x = as.factor(Variable), y = mean)) +
  geom_errorbar(aes(ymin = mean - 1.96*se, ymax = mean + 1.96*se, colour = as.factor(group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(group)), position=position_dodge(.2), size = 4) +
  labs(y = 'Mean Difference in\nThermometer Score\nUSR-PLUS voters (February 2021)', x = "") +
  scale_y_continuous(breaks = seq(0, 80, 10), limits = c(0, 80)) +
  facet_grid(~group, scales = "free_x") +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))
  
ggsave("Plots/FigureA1_voters_Affective_USR_thermo_dif.pdf", dpi = 1200, width = 10, height = 10, unit = "in")
```

## Figure A.2

```{r}

# Thermometer scores

## Activists

data3 %>%
  dplyr::select(ID, Thermo_PSD_leaders, Thermo_PSD, Thermo_PSD_members, Thermo_PSD_voters, Thermo_PNL_leaders, Thermo_PNL, Thermo_PNL_members, Thermo_PNL_voters) %>%
  pivot_longer(-c(ID), names_to = "Variable", values_to = "Value") %>%
  group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_PSD_leaders",  "Thermo_PSD", "Thermo_PSD_members", "Thermo_PSD_voters", "Thermo_PNL_leaders", "Thermo_PNL", "Thermo_PNL_members", "Thermo_PNL_voters"),
                      labels = c("PSD\nleaders", "PSD", "PSD\nmembers and\nsympathizers", "PSD\nvoters", "PNL\nleaders", "PNL", "PNL\nmembers and\nsympathizers", "PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, colour = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(Group)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Thermometer Score\nUSR-PLUS activists\n(January - February 2021)", x = "") +
  facet_grid(~Group, scales = "free_x") +
  scale_y_continuous(breaks = seq(0, 60, 10), limits = c(0, 60)) +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))

ggsave("Plots/FigureA2_activists_Thermo_total_w3_alt.pdf", dpi = 1200, width = 10, height = 10, unit = "in")

## Voters

voters_usrplus %>%
  dplyr::select(ID, PSD_leaders_termo, PSD_termo, PSD_members_termo, PSD_voters_termo, PNL_leaders_termo, PNL_termo, PNL_members_termo, PNL_voters_termo) %>%
  pivot_longer(-ID, names_to = "Variable", values_to = "Value") %>% 
  group_by(Variable) %>% 
  dplyr::summarise(mean = mean(Value, na.rm = T),
            se = se(Value, na.rm = T)) %>%
  mutate(group = rep(1:2, each = 4),
             group = factor(group, ordered = TRUE, 
                   levels = c("2",  "1"),
                   labels = c("PSD",  "PNL")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("PSD_leaders_termo",  "PSD_termo", "PSD_members_termo", "PSD_voters_termo", "PNL_leaders_termo", "PNL_termo", "PNL_members_termo", "PNL_voters_termo"),
                      labels = c("PSD\nleaders", "PSD", "PSD\nmembers and\nsympathizers", "PSD\nvoters", "PNL\nleaders", "PNL", "PNL\nmembers and\nsympathizers", "PNL\nvoters"))) %>%
  ggplot(aes(x = as.factor(Variable), y = mean)) +
  geom_errorbar(aes(ymin = mean - 1.96*se, ymax = mean + 1.96*se, colour = as.factor(group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(group)), position=position_dodge(.2), size = 4) +
  labs(y = 'Mean Thermometer Score\nUSR-PLUS voters (February 2021)', x = "") +
  facet_grid(~group, scales = "free_x") +
  scale_y_continuous(breaks = seq(0, 60, 10), limits = c(0, 60)) +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))
  
ggsave("Plots/FigureA2_voters_Affective_USR_thermo.pdf", dpi = 1200, width = 10, height = 10, unit = "in")
```

## Figure B.1

```{r}

# Bucharest - Ilfov membership

bucif <- readRDS("USRPLUS_membership_BucIF.RDS")

bucif %>%
  ggplot(aes(x = Variable, y = mean)) +
  geom_col(fill = "white", color = "red4", width = .5) +
  geom_text(aes(label = round(mean, 1)), size = 7, fontface = "bold", hjust = -1) +
  scale_y_continuous(breaks = seq(0, 100, 10), limits = c(0, 100)) +
  scale_x_discrete(labels=c("Ilfov" = "Ilfov (%)", "Female" = "Female (%)", "Bucuresti" = "Bucharest (%)", "Age" = "Mean age (years)", "Political_position_yes" = "Elected position (%)", "Sector1" = "District 1 (%)", "Sector2" = "District 2 (%)", "Sector3" = "District 3 (%)", "Sector4" = "District 4 (%)", "Sector5" = "District 5 (%)", "Sector6" = "District 6 (%)")) +
  labs(y = "Value", x = "", title = "USR-PLUS Membership characteristics\n(Bucharest-Ilfov, February 2021)") +
  coord_flip() +
  theme_bw() +
  theme(plot.title = element_text(hjust = 0.5)) +
  theme(text = element_text(size=20)) +
  theme(strip.text.x = element_text(size = 20, face="bold")) +
  theme(strip.text.y = element_text(size = 20, face="bold")) +
  theme(axis.text.x= element_text(size = 20)) +
  theme(axis.text.y = element_text(size = 20)) +
  theme(axis.title.x= element_text(size = 26)) +
  theme(axis.title.y = element_text(size = 26)) +
  theme(plot.title = element_text(hjust = 0.5, face="bold", size = 26))

ggsave("Plots/FigureB1_USRPLUSmembership_Feb2021_BucIF.pdf", dpi = 1200, width = 11, height = 10, unit = "in")

# Activist sample

sample_w12 = w12_long %>% 
  dplyr::select(RecipientFirstName, Wave, County_residence, District_Bucharest, Female, Age) %>%
  group_by(RecipientFirstName) %>%
  mutate(Bucharest = ifelse(County_residence == "Bucharest", 1, 0),
         Ilfov = ifelse(County_residence == "Ilfov", 1, 0),
         District_1 = ifelse(District_Bucharest == "District 1", 1, 0),
         District_2 = ifelse(District_Bucharest == "District 2", 1, 0),
         District_3 = ifelse(District_Bucharest == "District 3", 1, 0),
         District_4 = ifelse(District_Bucharest == "District 4", 1, 0),
         District_5 = ifelse(District_Bucharest == "District 5", 1, 0),
         District_6 = ifelse(District_Bucharest == "District 6", 1, 0)) %>%
  filter(Wave == 2)  

sample_w12 %>% 
  dplyr::select(RecipientFirstName, Bucharest, Ilfov, District_1, District_2,  District_3, District_4, District_5, District_6, Female, Age) %>%
  pivot_longer(-c(RecipientFirstName), names_to = "Variable", values_to = "Value") %>%
  group_by(Variable) %>%
  dplyr::summarise(mean = mean(Value, na.rm = T)) %>%
  mutate(mean = ifelse(Variable == "Age", mean, round(mean*100, 2))) %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                               levels = c("Age", "Bucharest", "Female", "Ilfov", "District_1", "District_2", "District_3", "District_4",  "District_5", "District_6"))) %>%
  ggplot(aes(x = Variable, y = mean)) +
  geom_col(fill = "white", color = "darkgreen", width = .5) +
  geom_text(aes(label = round(mean, 1)), size = 7, fontface = "bold", hjust = -1) +
  scale_y_continuous(breaks = seq(0, 100, 10), limits = c(0, 100)) +
  scale_x_discrete(labels=c("Ilfov" = "Ilfov (%)", "Female" = "Female (%)", "Bucharest" = "Bucharest (%)", "Age" = "Mean age (years)", "District_1" = "District 1 (%)", "District_2" = "District 2 (%)", "District_3" = "District 3 (%)", "District_4" = "District 4 (%)", "District_5" = "District 5 (%)", "District_6" = "District 6 (%)")) +
  labs(y = "Value", x = "", title = "USR-PLUS Sample characteristics\n(Bucharest-Ilfov, December 2020)") +
  coord_flip() +
  theme_bw() +
  theme(plot.title = element_text(hjust = 0.5)) +
  theme(text = element_text(size=20)) +
  theme(strip.text.x = element_text(size = 20, face="bold")) +
  theme(strip.text.y = element_text(size = 20, face="bold")) +
  theme(axis.text.x= element_text(size = 20)) +
  theme(axis.text.y = element_text(size = 20)) +
  theme(axis.title.x= element_text(size = 26)) +
  theme(axis.title.y = element_text(size = 26)) +
  theme(plot.title = element_text(hjust = 0.5, face="bold", size = 26))

ggsave("Plots/FigureB1_w12_Sample_characteristics.pdf", dpi = 1200, width = 11, height = 10, unit = "in")
```

## Figure B.2

```{r}

# National membership

national <- readRDS("USRPLUS_membership_national.RDS")

national %>%
  ggplot(aes(x = Variable, y = mean)) +
  geom_col(fill = "white", color = "royalblue4", width = .5) +
  geom_text(aes(label = round(mean, 1)), size = 7, fontface = "bold", hjust = -1) +
  scale_y_continuous(breaks = seq(0, 50, 10), limits = c(0, 50)) +
  scale_x_discrete(labels=c("Ilfov" = "Ilfov (%)", "Female" = "Female (%)", "Bucuresti" = "Bucharest (%)", "Age" = "Mean age (years)", "Political_position_yes" = "Elected position (%)", "Sector1" = "District 1 (%)", "Sector2" = "District 2 (%)", "Sector3" = "District 3 (%)", "Sector4" = "District 4 (%)", "Sector5" = "District 5 (%)", "Sector6" = "District 6 (%)")) +
  labs(y = "Value", x = "", title = "USR-PLUS Membership characteristics\n(Romania, February 2021)") +
  coord_flip() +
  theme_bw() +
  theme(plot.title = element_text(hjust = 0.5)) +
  theme(text = element_text(size=20)) +
  theme(strip.text.x = element_text(size = 20, face="bold")) +
  theme(strip.text.y = element_text(size = 20, face="bold")) +
  theme(axis.text.x= element_text(size = 20)) +
  theme(axis.text.y = element_text(size = 20)) +
  theme(axis.title.x= element_text(size = 26)) +
  theme(axis.title.y = element_text(size = 26)) +
  theme(plot.title = element_text(hjust = 0.5, face="bold", size = 26))

ggsave("Plots/FigureB2_USRPLUSmembership_Feb2021_national.pdf", dpi = 1200, width = 11, height = 10, unit = "in")
```

## Figure C.1

```{r}

# Read the data

ess9 <- readRDS("ESS09_partisanship.RDS")

# Plot

ess9 %>%
ggplot(aes(x = reorder(Country, prop), y = prop, fill = factor(Rom))) +
geom_bar(stat = "identity") +
labs(x = "", y = "Feels closer to\na political party (%)", caption = "Source: ESS (2018 - Wave 9)") + 
geom_text(aes(label = prop), size = 9, fontface = "bold", hjust = +1.5, angle = 90, color = "white") +
  theme_bw() +
  theme(plot.title = element_text(colour = "blue", hjust = 0.5),
        axis.title.y = element_text(size = 28),
        axis.title.x = element_text(size = 28),
        panel.grid.major = element_blank(),
        strip.text.x = element_text(size = 20, face="bold"),
        strip.text.y = element_text(size = 20, face="bold"),
        axis.text.x = element_text(size=20, angle = 90, vjust = 0.5),
        axis.text.y = element_text(size=20),
        plot.caption = element_text(size=20),
        legend.title = element_text(size = 20),
        legend.text = element_text(size = 20)) +
  theme(legend.position="none") +
  scale_fill_manual(values = c("darkmagenta", "black"))

ggsave("Plots/FigureC1_ESS9_Partisanship.pdf", dpi = 1200, width = 15, height = 7.5, unit = "in")
```

## Table D.1

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_reason_delegate != "Random distribution" & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("%stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table D.2

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_reason_delegate != "Random distribution" & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_PNL12 = list()

models_PNL12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_PNL12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table D.3

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_reason_delegate != "Random distribution" & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table D.4

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_reason_delegate != "Random distribution" & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Figure E.1

```{r}

# Hartman and Hidalgo (2018) - waves 1 and 2 panel

panel12 = w12_long %>% 
  dplyr::mutate(University_ed = ifelse(Education %in% c("Graduate studies", "University"), 1, 0),
                Romanian = ifelse(Ethnicity %in% c("Romanian"), 1, 0),
                Married = ifelse(Marital_status %in% c("Married"), 1, 0),
                Over_10k = ifelse(Income_objective %in% c("Over 10000 lei"), 1, 0),
                Well_off = ifelse(Income_subjective %in% c("Everything we want", "Live well"), 1, 0)) %>%
  dplyr::filter(Wave == 2) %>%
  as.data.frame()

replicate_strict = as.data.frame(run_equiv(X = subset(panel12, select = c("Age", "Female", "University_ed", "Urban", "Romanian", "Married", "Over_10k", "Well_off", "Political_efficacy", "Ideology", "Political_news")), 
                                           Tr = panel12$Delegate_vote_total, epsilon.method = "custom", custom.epsilon = 0.36,
                                           fdr_correct = TRUE))

g1 <- generate_plot(replicate_strict, panel.widths = c(2.5, 1.25, 5, 1.2, 1.2), 
              display.names = c("Age", "Female", "University education", "Urban residence", "Romanian", "Married", "Income (objective) - Over 10000 lei", "Income (subjective) - Well off", "Political efficacy", "Ideology", "Political news consumption"), 
              pval.rounding = 3, fdr_correct = TRUE)

ggsave("Plots/FigureE1_Balance_Hartman_w12_panel_delegates.png", g1, dpi = 600, width = 13, height = 7.5, unit = "in", device = "png")
```

## Figure E.2

```{r}

# Hartman and Hidalgo (2018) - waves 1 and 3 panel

panel13 = w13_long %>% 
  dplyr::mutate(University_ed = ifelse(Education %in% c("Graduate studies", "University"), 1, 0),
                Romanian = ifelse(Ethnicity %in% c("Romanian"), 1, 0),
                Married = ifelse(Marital_status %in% c("Married"), 1, 0),
                Over_10k = ifelse(Income_objective %in% c("Over 10000 lei"), 1, 0),
                Well_off = ifelse(Income_subjective %in% c("Everything we want", "Live well"), 1, 0)) %>%
  dplyr::filter(Wave == 3) %>%
  as.data.frame()

replicate_strict = as.data.frame(run_equiv(X = subset(panel13, select = c("Age", "Female", "University_ed", "Urban", "Romanian", "Married", "Over_10k", "Well_off", "Political_efficacy", "Ideology", "Political_news")), 
                                           Tr = panel13$Delegate_vote_total, epsilon.method = "custom", custom.epsilon = 0.36,
                                           fdr_correct = TRUE))


g2 <- generate_plot(replicate_strict, panel.widths = c(2.5, 1.25, 5, 1.2, 1.2), 
              display.names = c("Age", "Female", "University education", "Urban residence", "Romanian", "Married", "Income (objective) - Over 10000 lei", "Income (subjective) - Well off", "Political efficacy", "Ideology", "Political news consumption"), 
              pval.rounding = 3, fdr_correct = TRUE)

ggsave("Plots/FigureE2_Balance_Hartman_w13_panel_delegates.png", g2, dpi = 600, width = 13, height = 7.5, unit = "in", device = "png")
```

## Figure E.3

```{r}

# Hartman and Hidalgo (2018) - cross-sectional data (waves 1 and 2)

replicate_strict = as.data.frame(run_equiv(X = subset(data12, select = c("Delegate_vote_total", "Identity_USRPLUS_s", "Age", "Female", "University_ed", "Urban", "Romanian", "Married", "Over_10k", "Well_off", "Political_efficacy", "Ideology", "Political_news")), 
                                           Tr = data12$Period, epsilon.method = "custom", custom.epsilon = 0.36,
                                           fdr_correct = TRUE))


g1 <- generate_plot(replicate_strict, panel.widths = c(2.5, 1.25, 5, 1.2, 1.2), 
              display.names = c("Delegate", "USR-PLUS Social identity", "Age", "Female", "University education", "Urban residence", "Romanian", "Married", "Income (objective) - Over 10000 lei", "Income (subjective) - Well off", "Political efficacy", "Ideology", "Political news consumption"), 
              pval.rounding = 3, fdr_correct = TRUE)

ggsave("Plots/FigureE3_Balance_Hartman_w12.png", g1, dpi = 600, width = 13, height = 7.5, unit = "in", device = "png")
```

## Figure E.4

```{r}

# Hartman and Hidalgo (2018) - cross-sectional data (waves 1 and 3)

replicate_strict = as.data.frame(run_equiv(X = subset(data13, select = c("Delegate_vote_total", "Identity_USRPLUS_s", "Age", "Female", "University_ed", "Urban", "Romanian", "Married", "Over_10k", "Well_off", "Political_efficacy", "Ideology", "Political_news")), 
                                           Tr = data13$Period, epsilon.method = "custom", custom.epsilon = 0.36,
                                           fdr_correct = TRUE))


g1 <- generate_plot(replicate_strict, panel.widths = c(2.5, 1.25, 5, 1.2, 1.2), 
              display.names = c("Delegate", "USR-PLUS Social identity", "Age", "Female", "University education", "Urban residence", "Romanian", "Married", "Income (objective) - Over 10000 lei", "Income (subjective) - Well off", "Political efficacy", "Ideology", "Political news consumption"), 
              pval.rounding = 3, fdr_correct = TRUE)

ggsave("Plots/FigureE4_Balance_Hartman_w13.png", g1, dpi = 600, width = 13, height = 7.5, unit = "in", device = "png")
```

## Table E.1

```{r}

w12_long1 = merge(wave1_usrplus, wave2_usrplus, all=T)

panel_data12 = w12_long1 %>%
  group_by(RecipientFirstName) %>%
  mutate(Attrition = ifelse(n_distinct(Wave) == 2, 0, 1)) %>%  
  mutate(Age_over30 = ifelse(Age > 30, 1, 0),
         University_ed = ifelse(Education %in% c("Graduate studies", "University"), 1, 0),
         Romanian = ifelse(Ethnicity %in% c("Romanian"), 1, 0),
         Married = ifelse(Marital_status %in% c("Married"), 1, 0),
         Well_off = ifelse(Income_subjective %in% c("Everything we want", "Live well"), 1, 0),
         Right_ideology = ifelse(Ideology >= 6, 1, 0),
         Political_news_atleastdaily = ifelse(Political_news >= 3, 1, 0)) 

# Modelling attrition - panel data (waves 1 and 2)

model_att_w12 = lm(data = panel_data12, Attrition ~ Age_over30 + Female + University_ed + Urban + Romanian + Married + Well_off + Political_efficacy + Party_member_yes + Right_ideology + Political_news_atleastdaily)

screenreg(model_att_w12, single.row = T, custom.model.names = "Attrition (wave 1 and 2) (1)", custom.coef.names = c("Intercept", "Age (over 30)", "Female", "University education", "Urban residence", "Romanian", "Married", "Income (subjective) - Well off", "Political efficacy", "Party member", "Ideology (right)", "Political news consumption (at least daily)"), reorder.coef = c(2:12, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variable: probability of attrition (binary)."), caption.above = T, caption = "The determinants of attrition (panel data, waves 1 and 2)")
```

## Table E.2

```{r}

w13_long1 = merge(wave1_usrplus, wave3_usrplus, all=T)

panel_data13 = w13_long1 %>%
  group_by(RecipientFirstName) %>%
  mutate(Attrition = ifelse(n_distinct(Wave) == 2, 0, 1)) %>%  
  mutate(Age_over30 = ifelse(Age > 30, 1, 0),
         University_ed = ifelse(Education %in% c("Graduate studies", "University"), 1, 0),
         Romanian = ifelse(Ethnicity %in% c("Romanian"), 1, 0),
         Married = ifelse(Marital_status %in% c("Married"), 1, 0),
         Well_off = ifelse(Income_subjective %in% c("Everything we want", "Live well"), 1, 0),
         Right_ideology = ifelse(Ideology >= 6, 1, 0),
         Political_news_atleastdaily = ifelse(Political_news >= 3, 1, 0)) 

# Modelling attrition - panel data (waves 1 and 3)

model_att_w13 = lm(data = panel_data13, Attrition ~ Age_over30 + Female + University_ed + Urban + Romanian + Married + Well_off + Political_efficacy + Party_member_yes + Right_ideology + Political_news_atleastdaily)

screenreg(model_att_w13, single.row = T, custom.model.names = "Attrition (wave 1 and 3) (1)", custom.coef.names = c("Intercept", "Age (over 30)", "Female", "University education", "Urban residence", "Romanian", "Married", "Income (subjective) - Well off", "Political efficacy", "Party member", "Ideology (right)", "Political news consumption (at least daily)"), reorder.coef = c(2:12, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variable: probability of attrition (binary)."), caption.above = T, caption = "The determinants of attrition (panel data, waves 1 and 3)")
```

## Table E.3

```{r}

# Panel data (waves 1 and 2)

panel_data12 = w12_long1 %>%
  group_by(RecipientFirstName) %>%
  mutate(Attrition = ifelse(n_distinct(Wave) == 2, 0, 1)) %>%  
  dplyr::filter(Wave == 1)

cor(panel_data12$Attrition, panel_data12$Delegate_vote_total, use = "complete.obs")

# Panel data (waves 1 and 3)

panel_data13 = w13_long1 %>%
  group_by(RecipientFirstName) %>%
  mutate(Attrition = ifelse(n_distinct(Wave) == 2, 0, 1)) %>%  
  dplyr::filter(Wave == 1)

cor(panel_data13$Attrition, panel_data13$Delegate_vote_total, use = "complete.obs")
```

## Table E.4

```{r}

# Panel data (waves 1 and 2)

panel_data12 = w12_long1 %>%
  group_by(RecipientFirstName) %>%
  mutate(Attrition = ifelse(n_distinct(Wave) == 2, 0, 1)) %>%  
  dplyr::filter(Wave == 1)

cor(panel_data12$Attrition, panel_data12$Thermo_diff_PSD_leaders, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Thermo_diff_PSD, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Thermo_diff_PSD_members, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Thermo_diff_PSD_voters, use = "complete.obs")

cor(panel_data12$Attrition, panel_data12$Good_diff_PSD_leaders, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Good_diff_PSD, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Good_diff_PSD_members, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Good_diff_PSD_voters, use = "complete.obs")

cor(panel_data12$Attrition, panel_data12$Thermo_diff_PNL_leaders, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Thermo_diff_PNL, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Thermo_diff_PNL_members, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Thermo_diff_PNL_voters, use = "complete.obs")

cor(panel_data12$Attrition, panel_data12$Good_diff_PNL_leaders, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Good_diff_PNL, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Good_diff_PNL_members, use = "complete.obs")
cor(panel_data12$Attrition, panel_data12$Good_diff_PNL_voters, use = "complete.obs")
```

## Table E.5

```{r}

# Panel data (waves 1 and 3)

panel_data13 = w13_long1 %>%
  group_by(RecipientFirstName) %>%
  mutate(Attrition = ifelse(n_distinct(Wave) == 2, 0, 1)) %>%  
  dplyr::filter(Wave == 1)

cor(panel_data13$Attrition, panel_data13$Thermo_diff_PSD_leaders, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Thermo_diff_PSD, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Thermo_diff_PSD_members, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Thermo_diff_PSD_voters, use = "complete.obs")

cor(panel_data13$Attrition, panel_data13$Good_diff_PSD_leaders, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Good_diff_PSD, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Good_diff_PSD_members, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Good_diff_PSD_voters, use = "complete.obs")

cor(panel_data13$Attrition, panel_data13$Thermo_diff_PNL_leaders, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Thermo_diff_PNL, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Thermo_diff_PNL_members, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Thermo_diff_PNL_voters, use = "complete.obs")

cor(panel_data13$Attrition, panel_data13$Good_diff_PNL_leaders, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Good_diff_PNL, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Good_diff_PNL_members, use = "complete.obs")
cor(panel_data13$Attrition, panel_data13$Good_diff_PNL_voters, use = "complete.obs")
```

## Table F.1

```{r}

# Cross-sectional data

## Wave 1
wave1_usrplus %>%
  dplyr::select(Delegate_vote_total) %>%
  group_by(Delegate_vote_total) %>%
  count()  %>%
  filter(!is.na(Delegate_vote_total))

## Wave 2
wave2_usrplus %>%
  dplyr::select(Delegate_vote_total) %>%
  group_by(Delegate_vote_total) %>%
  count()  %>%
  filter(!is.na(Delegate_vote_total))

## Wave 3
wave3_usrplus %>%
  dplyr::select(Delegate_vote_total) %>%
  group_by(Delegate_vote_total) %>%
  count()  %>%
  filter(!is.na(Delegate_vote_total))

# Panel data

## Panel data (waves 1 and 2) - No. observations

w12_long %>%
  dplyr::select(Delegate_vote_total) %>%
  group_by(Delegate_vote_total) %>%
  count() %>%
  filter(!is.na(Delegate_vote_total))

## Panel data (waves 1 and 3) - No. observations

w13_long %>%
  dplyr::select(Delegate_vote_total) %>%
  group_by(Delegate_vote_total) %>%
  count() %>%
  filter(!is.na(Delegate_vote_total))
```

## Table G.1

```{r}

# Panel data (waves 1 and 2) 
  
descriptives_12 = c("Thermo_diff_PSD_leaders_s", "Thermo_diff_PSD_s", "Thermo_diff_PSD_members_s", "Thermo_diff_PSD_voters_s","Good_diff_PSD_leaders_s","Good_diff_PSD_s", "Good_diff_PSD_members_s", "Good_diff_PSD_voters_s", "Thermo_diff_PNL_leaders_s", "Thermo_diff_PNL_s","Thermo_diff_PNL_members_s", "Thermo_diff_PNL_voters_s", "Good_diff_PNL_leaders_s",  "Good_diff_PNL_s", "Good_diff_PNL_members_s","Good_diff_PNL_voters_s", "Thermo_PSD_leaders_s",  "Thermo_PSD_s", "Thermo_PSD_members_s", "Thermo_PSD_voters_s", "Good_PSD_leaders_s", "Good_PSD_s",  "Good_PSD_members_s", "Good_PSD_voters_s", "Thermo_PNL_leaders_s", "Thermo_PNL_s", "Thermo_PNL_members_s", "Thermo_PNL_voters_s", "Good_PNL_leaders_s","Good_PNL_s", "Good_PNL_members_s", "Good_PNL_voters_s", "Delegate_vote_total", "Delegate_v2", "Wave", "Identity_USRPLUS_s", "Past_delegate_observer_yes", "Close_ones_PSD", "Close_ones_PNL", "Recent_discussions_PSD", "Recent_discussions_PNL", "Precinct_eval_voting_incidents", "Precinct_discussions_PSD_yes", "Precinct_discussions_PNL_yes", "Precinct_interactions_PSD_tensed", "Precinct_interactions_PNL_tensed", "Precinct_diff_firsttwo_less5", "Precinct_USRPLUS_standing_12")
  
w12_long %>%
  dplyr::select(descriptives_12) %>%
  psych::describe(., skew = TRUE, check = TRUE) %>%
  as.data.frame() %>%
  dplyr::select(n, mean, sd, median, min, max, se) %>%
  round(2) %>%
  xtable()
```

## Table G.2

```{r}

# Panel data (waves 1 and 3) 

descriptives_13 = c("Thermo_diff_PSD_leaders_s", "Thermo_diff_PSD_s", "Thermo_diff_PSD_members_s", "Thermo_diff_PSD_voters_s","Good_diff_PSD_leaders_s","Good_diff_PSD_s", "Good_diff_PSD_members_s", "Good_diff_PSD_voters_s", "Thermo_diff_PNL_leaders_s", "Thermo_diff_PNL_s","Thermo_diff_PNL_members_s", "Thermo_diff_PNL_voters_s", "Good_diff_PNL_leaders_s",  "Good_diff_PNL_s", "Good_diff_PNL_members_s","Good_diff_PNL_voters_s", "Thermo_PSD_leaders_s",  "Thermo_PSD_s", "Thermo_PSD_members_s", "Thermo_PSD_voters_s", "Good_PSD_leaders_s", "Good_PSD_s",  "Good_PSD_members_s", "Good_PSD_voters_s", "Thermo_PNL_leaders_s", "Thermo_PNL_s", "Thermo_PNL_members_s", "Thermo_PNL_voters_s", "Good_PNL_leaders_s","Good_PNL_s", "Good_PNL_members_s", "Good_PNL_voters_s",  "Delegate_vote_total", "Delegate_v2", "Wave", "Identity_USRPLUS_s")

w13_long %>%
  dplyr::select(descriptives_13) %>%
  psych::describe(., skew = TRUE, check = TRUE) %>%
  as.data.frame() %>%
  dplyr::select(n, mean, sd, median, min, max, se) %>%
  round(2) %>%
  xtable()
```

## Table G.3

```{r}

# Cross-sectional data (waves 1 and 2) 

descriptives12 = c("Thermo_diff_PSD_leaders_s", "Thermo_diff_PSD_s", "Thermo_diff_PSD_members_s", "Thermo_diff_PSD_voters_s", "Thermo_diff_PNL_leaders_s", "Thermo_diff_PNL_s", "Thermo_diff_PNL_members_s", "Thermo_diff_PNL_voters_s",  "Good_diff_PSD_leaders_s", "Good_diff_PSD_s", "Good_diff_PSD_members_s", "Good_diff_PSD_voters_s", "Good_diff_PNL_leaders_s", "Good_diff_PNL_s", "Good_diff_PNL_members_s", "Good_diff_PNL_voters_s", "Thermo_PSD_leaders_s", "Thermo_PSD_s", "Thermo_PSD_members_s", "Thermo_PSD_voters_s", "Thermo_PNL_leaders_s", "Thermo_PNL_s", "Thermo_PNL_members_s", "Thermo_PNL_voters_s",  "Good_PSD_leaders_s", "Good_PSD_s", "Good_PSD_members_s", "Good_PSD_voters_s", "Good_PNL_leaders_s", "Good_PNL_s", "Good_PNL_members_s", "Good_PNL_voters_s", "Delegate_vote_total", "Identity_USRPLUS_s", "Age", "Female", "University_ed", "Urban", "Romanian", "Married", "Over_10k", "Well_off", "Political_efficacy", "Ideology", "Political_news", "Wave", "Period")

data12 %>%
  dplyr::select(descriptives12) %>%
  psych::describe(., skew = TRUE, check = TRUE) %>%
  as.data.frame() %>%
  dplyr::select(n, mean, sd, median, min, max, se) %>%
  round(2) %>%
  xtable()
```

## Table G.4

```{r}

# Cross-sectional data (waves 1 and 3) 

descriptives13 = c("Thermo_diff_PSD_leaders_s", "Thermo_diff_PSD_s", "Thermo_diff_PSD_members_s", "Thermo_diff_PSD_voters_s", "Thermo_diff_PNL_leaders_s", "Thermo_diff_PNL_s", "Thermo_diff_PNL_members_s", "Thermo_diff_PNL_voters_s",  "Good_diff_PSD_leaders_s", "Good_diff_PSD_s", "Good_diff_PSD_members_s", "Good_diff_PSD_voters_s", "Good_diff_PNL_leaders_s", "Good_diff_PNL_s", "Good_diff_PNL_members_s", "Good_diff_PNL_voters_s", "Thermo_PSD_leaders_s", "Thermo_PSD_s", "Thermo_PSD_members_s", "Thermo_PSD_voters_s", "Thermo_PNL_leaders_s", "Thermo_PNL_s", "Thermo_PNL_members_s", "Thermo_PNL_voters_s",  "Good_PSD_leaders_s", "Good_PSD_s", "Good_PSD_members_s", "Good_PSD_voters_s", "Good_PNL_leaders_s", "Good_PNL_s", "Good_PNL_members_s", "Good_PNL_voters_s", "Delegate_vote_total", "Identity_USRPLUS_s", "Age", "Female", "University_ed", "Urban", "Romanian", "Married", "Over_10k", "Well_off", "Political_efficacy", "Ideology", "Political_news", "Wave", "Period")

data13 %>%
  dplyr::select(descriptives13) %>%
  psych::describe(., skew = TRUE, check = TRUE) %>%
  as.data.frame() %>%
  dplyr::select(n, mean, sd, median, min, max, se) %>%
  round(2) %>%
  xtable()
```

## Table H.1

```{r}

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_long, Thermo_diff_PSD_leaders ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_long, Thermo_diff_PSD ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_long, Thermo_diff_PSD_members ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_long, Thermo_diff_PSD_voters ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_long, Good_diff_PSD_leaders ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_long, Good_diff_PSD ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_long, Good_diff_PSD_members ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_long, Good_diff_PSD_voters ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table H.2

```{r}

models_PNL12 = list()

models_PNL12[[1]] = felm(data = w12_long, Thermo_diff_PNL_leaders ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[2]] = felm(data = w12_long, Thermo_diff_PNL ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[3]] = felm(data = w12_long, Thermo_diff_PNL_members ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[4]] = felm(data = w12_long, Thermo_diff_PNL_voters ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[5]] = felm(data = w12_long, Good_diff_PNL_leaders ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[6]] = felm(data = w12_long, Good_diff_PNL ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[7]] = felm(data = w12_long, Good_diff_PNL_members ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[8]] = felm(data = w12_long, Good_diff_PNL_voters ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_PNL12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table H.3

```{r}

models_psd13 = list()

models_psd13[[1]] = felm(data = w13_long, Thermo_diff_PSD_leaders ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[2]] = felm(data = w13_long, Thermo_diff_PSD ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[3]] = felm(data = w13_long, Thermo_diff_PSD_members ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[4]] = felm(data = w13_long, Thermo_diff_PSD_voters ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[5]] = felm(data = w13_long, Good_diff_PSD_leaders ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[6]] = felm(data = w13_long, Good_diff_PSD ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[7]] = felm(data = w13_long, Good_diff_PSD_members ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[8]] = felm(data = w13_long, Good_diff_PSD_voters ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_psd13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table H.4

```{r}

models_PNL13 = list()

models_PNL13[[1]] = felm(data = w13_long, Thermo_diff_PNL_leaders ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[2]] = felm(data = w13_long, Thermo_diff_PNL ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[3]] = felm(data = w13_long, Thermo_diff_PNL_members ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[4]] = felm(data = w13_long, Thermo_diff_PNL_voters ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[5]] = felm(data = w13_long, Good_diff_PNL_leaders ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[6]] = felm(data = w13_long, Good_diff_PNL ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[7]] = felm(data = w13_long, Good_diff_PNL_members ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[8]] = felm(data = w13_long, Good_diff_PNL_voters ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_PNL13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table H.5

```{r}

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_long, Thermo_diff_PSD_leaders ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_long, Thermo_diff_PSD ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_long, Thermo_diff_PSD_members ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_long, Thermo_diff_PSD_voters ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_long, Good_diff_PSD_leaders ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_long, Good_diff_PSD ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_long, Good_diff_PSD_members ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_long, Good_diff_PSD_voters ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table H.6

```{r}

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_long, Thermo_diff_PNL_leaders ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_long, Thermo_diff_PNL ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_long, Thermo_diff_PNL_members ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_long, Thermo_diff_PNL_voters ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_long, Good_diff_PNL_leaders ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_long, Good_diff_PNL ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_long, Good_diff_PNL_members ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_long, Good_diff_PNL_voters ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table H.7

```{r}

models_psd13 = list()

models_psd13[[1]] = felm(data = w13_long, Thermo_diff_PSD_leaders ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[2]] = felm(data = w13_long, Thermo_diff_PSD ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[3]] = felm(data = w13_long, Thermo_diff_PSD_members ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[4]] = felm(data = w13_long, Thermo_diff_PSD_voters ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[5]] = felm(data = w13_long, Good_diff_PSD_leaders ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[6]] = felm(data = w13_long, Good_diff_PSD ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[7]] = felm(data = w13_long, Good_diff_PSD_members ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[8]] = felm(data = w13_long, Good_diff_PSD_voters ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table H.8

```{r}

models_pnl13 = list()

models_pnl13[[1]] = felm(data = w13_long, Thermo_diff_PNL_leaders ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[2]] = felm(data = w13_long, Thermo_diff_PNL ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[3]] = felm(data = w13_long, Thermo_diff_PNL_members ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[4]] = felm(data = w13_long, Thermo_diff_PNL_voters ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[5]] = felm(data = w13_long, Good_diff_PNL_leaders ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[6]] = felm(data = w13_long, Good_diff_PNL ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[7]] = felm(data = w13_long, Good_diff_PNL_members ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[8]] = felm(data = w13_long, Good_diff_PNL_voters ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Figure I.1

```{r}

# Thermometer scores

w12_long %>%
  dplyr::filter(Wave == 1) %>%
  dplyr::select(RecipientFirstName, Thermo_PSD_leaders, Thermo_PSD, Thermo_PSD_members, Thermo_PSD_voters, Thermo_PNL_leaders, Thermo_PNL, Thermo_PNL_members, Thermo_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName), names_to = "Variable", values_to = "Value") %>%
  group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
                   se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_PSD_leaders",  "Thermo_PSD", "Thermo_PSD_members", "Thermo_PSD_voters", "Thermo_PNL_leaders", "Thermo_PNL", "Thermo_PNL_members", "Thermo_PNL_voters"),
                      labels = c("PSD\nleaders", "PSD", "PSD\nmembers and\nsympathizers", "PSD\nvoters", "PNL\nleaders", "PNL", "PNL\nmembers and\nsympathizers", "PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, colour = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(Group)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Thermometer Score (First wave)", x = "") +
  facet_grid(~Group, scales = "free_x") +
  #coord_flip() +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))

ggsave("Plots/FigureI1_Thermo_total_w1_alt_panel.pdf", dpi = 1200, width = 15, height = 10, unit = "in")

# Best scores

w12_long %>%
  dplyr::filter(Wave == 1) %>%
  dplyr::select(RecipientFirstName, Good_PSD_leaders, Good_PSD, Good_PSD_members, Good_PSD_voters, Good_PNL_leaders, Good_PNL, Good_PNL_members, Good_PNL_voters) %>%
  #drop_na %>%
  pivot_longer(-c(RecipientFirstName), names_to = "Variable", values_to = "Value") %>%
  dplyr::group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
                   se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_PSD_leaders", "Good_PSD", "Good_PSD_members", "Good_PSD_voters", "Good_PNL_leaders",  "Good_PNL", "Good_PNL_members",  "Good_PNL_voters"),
                      labels = c("PSD\nleaders", "PSD", "PSD\nmembers and\nsympathizers", "PSD\nvoters", "PNL\nleaders", "PNL", "PNL\nmembers and\nsympathizers", "PNL\nvoters"))) %>%
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, colour = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(Group)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Best for Romania variable\n(First wave)", x = "") +
  facet_grid(~Group, scales = "free_x") +
  #coord_flip() +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))

ggsave("Plots/FigureI1_Good_total_w1_alt_panel.pdf", dpi = 1200, width = 15, height = 10, unit = "in")
```

## Figure I.2

```{r}

# Thermometer scores

data1 %>%
  dplyr::select(ID, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters) %>%
  pivot_longer(-c(ID), names_to = "Variable", values_to = "Value") %>%
  group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
                   se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_diff_PSD_leaders",  "Thermo_diff_PSD", "Thermo_diff_PSD_members", "Thermo_diff_PSD_voters", "Thermo_diff_PNL_leaders", "Thermo_diff_PNL", "Thermo_diff_PNL_members", "Thermo_diff_PNL_voters"),
                      labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters", "USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, colour = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(Group)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nThermometer Score (First wave)", x = "") +
  facet_grid(~Group, scales = "free_x") +
  #coord_flip() +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))

ggsave("Plots/FigureI2_Thermo_total_w1_main.pdf", dpi = 1200, width = 15, height = 10, unit = "in")

# Best scores

data1 %>%
  dplyr::select(ID, Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters) %>%
  #drop_na %>%
  pivot_longer(-c(ID), names_to = "Variable", values_to = "Value") %>%
  dplyr::group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
                   se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_diff_PSD_leaders", "Good_diff_PSD", "Good_diff_PSD_members", "Good_diff_PSD_voters", "Good_diff_PNL_leaders",  "Good_diff_PNL", "Good_diff_PNL_members",  "Good_diff_PNL_voters"),
                      labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters", "USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters"))) %>%
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, colour = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(Group)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in the\nBest for Romania variable\n(First wave)", x = "") +
  facet_grid(~Group, scales = "free_x") +
  #coord_flip() +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))

ggsave("Plots/FigureI2_Good_total_w1_main.pdf", dpi = 1200, width = 15, height = 10, unit = "in")
```

## Figure I.3

```{r}

# Thermometer scores

data1 %>%
  dplyr::select(ID, Thermo_PSD_leaders, Thermo_PSD, Thermo_PSD_members, Thermo_PSD_voters, Thermo_PNL_leaders, Thermo_PNL, Thermo_PNL_members, Thermo_PNL_voters) %>%
  pivot_longer(-c(ID), names_to = "Variable", values_to = "Value") %>%
  group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
                   se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_PSD_leaders",  "Thermo_PSD", "Thermo_PSD_members", "Thermo_PSD_voters", "Thermo_PNL_leaders", "Thermo_PNL", "Thermo_PNL_members", "Thermo_PNL_voters"),
                      labels = c("PSD\nleaders", "PSD", "PSD\nmembers and\nsympathizers", "PSD\nvoters", "PNL\nleaders", "PNL", "PNL\nmembers and\nsympathizers", "PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, colour = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(Group)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Thermometer Score (First wave)", x = "") +
  facet_grid(~Group, scales = "free_x") +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))

ggsave("Plots/FigureI3_Thermo_total_w1_alt.pdf", dpi = 1200, width = 15, height = 10, unit = "in")

# Best scores

data1 %>%
  dplyr::select(ID, Good_PSD_leaders, Good_PSD, Good_PSD_members, Good_PSD_voters, Good_PNL_leaders, Good_PNL, Good_PNL_members, Good_PNL_voters) %>%
  pivot_longer(-c(ID), names_to = "Variable", values_to = "Value") %>%
  dplyr::group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
                   se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_PSD_leaders", "Good_PSD", "Good_PSD_members", "Good_PSD_voters", "Good_PNL_leaders",  "Good_PNL", "Good_PNL_members",  "Good_PNL_voters"),
                      labels = c("PSD\nleaders", "PSD", "PSD\nmembers and\nsympathizers", "PSD\nvoters", "PNL\nleaders", "PNL", "PNL\nmembers and\nsympathizers", "PNL\nvoters"))) %>%
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, colour = as.factor(Group)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(colour = as.factor(Group)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Best for Romania variable\n(First wave)", x = "") +
  facet_grid(~Group, scales = "free_x") +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("red", "blue"))

ggsave("Plots/FigureI3_Good_total_w1_alt.pdf", dpi = 1200, width = 15, height = 10, unit = "in")
```

## Figure I.4

```{r}

# Thermometer scores

w12_long %>%
  dplyr::filter(Wave == 1) %>%
  dplyr::select(RecipientFirstName, Thermo_USRPLUS_leaders, Thermo_USRPLUS, Thermo_USRPLUS_members, Thermo_USRPLUS_voters) %>%
  pivot_longer(-c(RecipientFirstName), names_to = "Variable", values_to = "Value") %>%
  group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
                   se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                           levels = c("Thermo_USRPLUS_leaders",  "Thermo_USRPLUS", "Thermo_USRPLUS_members", "Thermo_USRPLUS_voters"),
                           labels = c("USR-PLUS\nleaders", "USR-PLUS", "USR-PLUS\nmembers and\nsympathizers", "USR-PLUS\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se), width = 0, position=position_dodge(.2), size = 2, color = "red") + 
  geom_point(position=position_dodge(.2), size = 4, color = "red") +
  labs(y = "Mean Thermometer Score\nUSR-PLUS\n(First wave)", x = "") +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))

ggsave("Plots/FigureI4_Scores_thermo_w1_alt_panel_USR.pdf", dpi = 1200, width = 10, height = 7.5, unit = "in")

# Best scores

w12_long %>%
  dplyr::filter(Wave == 1) %>%
  dplyr::select(RecipientFirstName, Good_USRPLUS_leaders, Good_USRPLUS, Good_USRPLUS_members, Good_USRPLUS_voters) %>%
  pivot_longer(-c(RecipientFirstName), names_to = "Variable", values_to = "Value") %>%
  group_by(Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
                   se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                           levels = c("Good_USRPLUS_leaders",  "Good_USRPLUS", "Good_USRPLUS_members", "Good_USRPLUS_voters"),
                           labels = c("USR-PLUS\nleaders", "USR-PLUS", "USR-PLUS\nmembers and\nsympathizers", "USR-PLUS\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Variable), y = diff)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se), width = 0, position=position_dodge(.2), size = 2, color = "blue") + 
  geom_point(position=position_dodge(.2), size = 4, color = "blue") +
  labs(y = "Mean Best for Romania\nvariable USR-PLUS\n(First wave)", x = "") +
  theme +
  theme(legend.position = "none") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))

ggsave("Plots/FigureI4_Scores_good_w1_alt_panel_USR.pdf", dpi = 1200, width = 10, height = 7.5, unit = "in")
```

## Figure J.1

```{r}

# Thermometer scores

w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
                   se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "2"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 2\n(Post-election)")),
         Variable = factor(Variable, ordered = TRUE, 
                           levels = c("Thermo_diff_PSD_leaders",  "Thermo_diff_PSD", "Thermo_diff_PSD_members", "Thermo_diff_PSD_voters"),
                           labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nThermometer Score", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureJ1_w12_Thermo_PSD_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best scores

w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave,  Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
                   se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "2"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 2\n(Post-election)")),
         Variable = factor(Variable, ordered = TRUE, 
                           levels = c("Good_diff_PSD_leaders", "Good_diff_PSD", "Good_diff_PSD_members", "Good_diff_PSD_voters"),
                           labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nthe Best for Romania variable", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureJ1_w12_Good_PSD_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

```

## Figure J.2

```{r}

# Thermometer scores

w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_PSD_leaders, Thermo_PSD, Thermo_PSD_members, Thermo_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "2"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 2\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_PSD_leaders",  "Thermo_PSD", "Thermo_PSD_members", "Thermo_PSD_voters"),
                      labels = c("PSD\nleaders", "PSD", "PSD\nmembers and\nsympathizers", "PSD\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean\nThermometer Score", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureJ2_w12_Thermo_PSD_delegates_uns_alt.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best scores

w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave,  Good_PSD_leaders, Good_PSD, Good_PSD_members, Good_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "2"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 2\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_PSD_leaders", "Good_PSD", "Good_PSD_members", "Good_PSD_voters"),
                      labels = c("PSD\nleaders", "PSD", "PSD\nmembers and\nsympathizers", "PSD\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean\nthe Best for Romania variable", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureJ2_w12_Good_PSD_delegates_uns_alt.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")
```

## Table J.1

```{r}

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_long, Thermo_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_long, Thermo_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_long, Thermo_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_long, Thermo_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_long, Good_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_long, Good_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_long, Good_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_long, Good_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: PSD leaders, thermometer scores - model 1; PSD, thermometer scores - model 2; PSD members and sympathizers, thermometer scores - model 3; PSD voters, thermometer scores - model 4; PSD leaders, Best for Romania scores - model 5; PSD, Best for Romania scores - model 6; PSD members and sympathizers, Best for Romania scores - model 7; PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table J.2 

```{r}

models_psd12 = list()

models_psd12[[1]] = lm(data = data12, Thermo_diff_PSD_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[2]] = lm(data = data12, Thermo_diff_PSD_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[3]] = lm(data = data12, Thermo_diff_PSD_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[4]] = lm(data = data12, Thermo_diff_PSD_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[5]] = lm(data = data12, Good_diff_PSD_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[6]] = lm(data = data12, Good_diff_PSD_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[7]] = lm(data = data12, Good_diff_PSD_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[8]] = lm(data = data12, Good_diff_PSD_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_psd12, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period", "Delegate", "Delegate x Post-election period"), reorder.coef = c(4, 3, 2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of observing the election on affective polarization towards PSD - Waves 1 and 2 (cross-sectional data)")
```

## Table J.3

```{r}

models_psd12 = list()

models_psd12[[1]] = lm(data = data12, Thermo_PSD_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[2]] = lm(data = data12, Thermo_PSD_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[3]] = lm(data = data12, Thermo_PSD_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[4]] = lm(data = data12, Thermo_PSD_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[5]] = lm(data = data12, Good_PSD_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[6]] = lm(data = data12, Good_PSD_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[7]] = lm(data = data12, Good_PSD_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[8]] = lm(data = data12, Good_PSD_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_psd12, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period", "Delegate", "Delegate x Post-election period"), reorder.coef = c(4, 3, 2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: PSD leaders, thermometer scores - model 1; PSD, thermometer scores - model 2; PSD members and sympathizers, thermometer scores - model 3; PSD voters, thermometer scores - model 4; PSD leaders, Best for Romania scores - model 5; PSD, Best for Romania scores - model 6; PSD members and sympathizers, Best for Romania scores - model 7; PSD voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of observing the election on affective polarization towards PSD - Waves 1 and 2 (cross-sectional data) - alternative measure of the dependent variable")
```

## Figure J.3

```{r}

# Thermometer scores - Affective polarization USR-PLUS - PNL

w12_wide = w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters) %>%
  pivot_wider(
    id_cols = RecipientFirstName,
    names_from = Wave,
    values_from = c(Delegate_vote_total, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters)) %>%
  mutate(w12_PNL_leaders = Thermo_diff_PNL_leaders_2 - Thermo_diff_PNL_leaders_1,
         w12_PNL = Thermo_diff_PNL_2 - Thermo_diff_PNL_1,
         w12_PNL_members = Thermo_diff_PNL_members_2 - Thermo_diff_PNL_members_1,
         w12_PNL_voters = Thermo_diff_PNL_voters_2 - Thermo_diff_PNL_voters_1)

w12_wide %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total_1, w12_PNL_leaders, w12_PNL, w12_PNL_members, w12_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total_1), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total_1, Variable) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                           levels = c("w12_PNL_leaders",  "w12_PNL", "w12_PNL_members", "w12_PNL_voters"),
                           labels = c("USR-PLUS - PNL\nleaders\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\nmembers and\nsympathizers\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\nvoters\n(Wave 2 - Wave 1)"))) %>%  
  ggplot(aes(x = Variable, y = diff), group = as.factor(Delegate_vote_total_1)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total_1), color = as.factor(Delegate_vote_total_1)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total_1)), position=position_dodge(.2), size = 4) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black", size = 1) +
  labs(y = "Mean Difference in\nThermometer Score\n(Wave 2 - Wave 1)", x = "") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureJ3_w12_Thermo_PNL_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best for Romania scores - Affective polarization USR-PLUS - PNL

w12_wide1 = w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters) %>%
  pivot_wider(
    id_cols = RecipientFirstName,
    names_from = Wave,
    values_from = c(Delegate_vote_total, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters)) %>%
  mutate(w12_PNL_leaders = Good_diff_PNL_leaders_2 - Good_diff_PNL_leaders_1,
         w12_PNL = Good_diff_PNL_2 - Good_diff_PNL_1,
         w12_PNL_members = Good_diff_PNL_members_2 - Good_diff_PNL_members_1,
         w12_PNL_voters = Good_diff_PNL_voters_2 - Good_diff_PNL_voters_1)

w12_wide1 %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total_1, w12_PNL_leaders, w12_PNL, w12_PNL_members, w12_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total_1), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total_1, Variable) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                      levels = c("w12_PNL_leaders", "w12_PNL", "w12_PNL_members", "w12_PNL_voters"),
                      labels = c("USR-PLUS - PNL\nleaders\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\nmembers and\nsympathizers\n(Wave 2 - Wave 1)", "USR-PLUS - PNL\nvoters\n(Wave 2 - Wave 1)"))) %>%  
  ggplot(aes(x = Variable, y = diff), group = as.factor(Delegate_vote_total_1)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total_1), color = as.factor(Delegate_vote_total_1)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total_1)), position=position_dodge(.2), size = 4) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black", size = 1) +
  labs(y = "Mean Difference in\nthe Best for Romania variable\n(Wave 2 - Wave 1)", x = "") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureJ3_w12_Good_PNL_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")
```

## Figure J.4

```{r}

# Thermometer scores - Affective polarization USR-PLUS - PNL

w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "2"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 2\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_diff_PNL_leaders",  "Thermo_diff_PNL", "Thermo_diff_PNL_members", "Thermo_diff_PNL_voters"),
                      labels = c("USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nThermometer Score", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureJ4_w12_Thermo_PNL_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best for Romania scores - Affective polarization USR-PLUS - PNL

w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave,  Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "2"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 2\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_diff_PNL_leaders", "Good_diff_PNL", "Good_diff_PNL_members", "Good_diff_PNL_voters"),
                      labels = c("USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nthe Best for Romania variable", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureJ4_w12_Good_PNL_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")
```

## Table J.4

```{r}

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_long, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_long, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_long, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_long, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_long, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_long, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_long, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_long, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table J.5

```{r}

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_long, Thermo_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_long, Thermo_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_long, Thermo_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_long, Thermo_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_long, Good_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_long, Good_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_long, Good_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_long, Good_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: PNL leaders, thermometer scores - model 1; PNL, thermometer scores - model 2; PNL members and sympathizers, thermometer scores - model 3; PNL voters, thermometer scores - model 4; PNL leaders, Best for Romania scores - model 5; PNL, Best for Romania scores - model 6; PNL members and sympathizers, Best for Romania scores - model 7; PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Figure J.5

```{r}

# Thermometer scores - PNL

w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_PNL_leaders, Thermo_PNL, Thermo_PNL_members, Thermo_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "2"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 2\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_PNL_leaders",  "Thermo_PNL", "Thermo_PNL_members", "Thermo_PNL_voters"),
                      labels = c("PNL\nleaders", "PNL", "PNL\nmembers and\nsympathizers", "PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean\nThermometer Score", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureJ5_w12_Thermo_PNL_delegates_uns_alt.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best for Romania scores - PNL

w12_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave,  Good_PNL_leaders, Good_PNL, Good_PNL_members, Good_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "2"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 2\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_PNL_leaders", "Good_PNL", "Good_PNL_members", "Good_PNL_voters"),
                      labels = c("PNL\nleaders", "PNL", "PNL\nmembers and\nsympathizers", "PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean\nthe Best for Romania variable", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureJ5_w12_Good_PNL_delegates_uns_alt.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")
```

## Table J.6

```{r}

models_PNL12 = list()

models_PNL12[[1]] = lm(data = data12, Thermo_diff_PNL_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[2]] = lm(data = data12, Thermo_diff_PNL_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[3]] = lm(data = data12, Thermo_diff_PNL_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[4]] = lm(data = data12, Thermo_diff_PNL_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[5]] = lm(data = data12, Good_diff_PNL_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[6]] = lm(data = data12, Good_diff_PNL_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[7]] = lm(data = data12, Good_diff_PNL_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[8]] = lm(data = data12, Good_diff_PNL_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_PNL12, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period", "Delegate", "Delegate x Post-election period"), reorder.coef = c(4, 3, 2, 1),  custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of observing the election on affective polarization towards PNL - Waves 1 and 2 (cross-sectional data)")
```

## Table J.7

```{r}

models_PNL12 = list()

models_PNL12[[1]] = lm(data = data12, Thermo_PNL_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[2]] = lm(data = data12, Thermo_PNL_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[3]] = lm(data = data12, Thermo_PNL_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[4]] = lm(data = data12, Thermo_PNL_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[5]] = lm(data = data12, Good_PNL_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[6]] = lm(data = data12, Good_PNL_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[7]] = lm(data = data12, Good_PNL_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[8]] = lm(data = data12, Good_PNL_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_PNL12, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period", "Delegate", "Delegate x Post-election period"), reorder.coef = c(4, 3, 2, 1),  custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: PNL leaders, thermometer scores - model 1; PNL, thermometer scores - model 2; PNL members and sympathizers, thermometer scores - model 3; PNL voters, thermometer scores - model 4; PNL leaders, Best for Romania scores - model 5; PNL, Best for Romania scores - model 6; PNL members and sympathizers, Best for Romania scores - model 7; PNL voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of observing the election on affective polarization towards PNL - Waves 1 and 2 (cross-sectional data) - alternative measure of the dependent variable")
```

## Figure K.1

```{r}

# Thermometer scores - Affective polarization

w12_long %>%
  dplyr::select(Wave, RecipientFirstName, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Wave, Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_diff_PSD_leaders",  "Thermo_diff_PSD", "Thermo_diff_PSD_members", "Thermo_diff_PSD_voters", "Thermo_diff_PNL_leaders", "Thermo_diff_PNL", "Thermo_diff_PNL_members", "Thermo_diff_PNL_voters"),
                      labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters", "USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters")),
    Wave = factor(Wave, ordered = TRUE, 
                  levels = c("1",  "2"),
                  labels = c("Wave 1\n(Pre-election)", "Wave 2\n(Post-election)"))) %>%  
  ggplot(aes(x = as.factor(Variable), y = diff), group = as.factor(Wave)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Wave), color = as.factor(Wave)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Wave)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nThermometer Score", x = "") +
  facet_grid(~Group, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("black", "red"))

ggsave("Plots/FigureK1_w12_Thermo_total_uns.pdf", dpi = 1200, width = 15, height = 10, unit = "in")

# Best for Romania scores - Affective polarization

w12_long %>%
  dplyr::select(Wave, RecipientFirstName, Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters) %>%
  #drop_na %>%
  pivot_longer(-c(RecipientFirstName, Wave), names_to = "Variable", values_to = "Value") %>%
  dplyr::group_by(Wave, Variable) %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Group = factor(case_when(
    str_detect(Variable, "PSD") ~ "PSD",
    str_detect(Variable, "PNL") ~ "PNL",
    TRUE ~ NA_character_)),
    Group = factor(Group, ordered = TRUE, 
                   levels = c("PSD",  "PNL"),
                   labels = c("PSD",  "PNL")),
    Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_diff_PSD_leaders", "Good_diff_PSD", "Good_diff_PSD_members", "Good_diff_PSD_voters", "Good_diff_PNL_leaders",  "Good_diff_PNL", "Good_diff_PNL_members",  "Good_diff_PNL_voters"),
                      labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters", "USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters")),
    Wave = factor(Wave, ordered = TRUE, 
                  levels = c("1",  "2"),
                  labels = c("Wave 1\n(Pre-election)", "Wave 2\n(Post-election)"))) %>%  
  ggplot(aes(x = as.factor(Variable), y = diff), group = as.factor(Wave)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Wave), color = as.factor(Wave)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Wave)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nthe Best for Romania variable", x = "") +
  facet_grid(~Group, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
  scale_color_manual(values=c("black", "red"))

ggsave("Plots/FigureK1_w12_Good_total_uns.pdf", dpi = 1200, width = 15, height = 10, unit = "in")
```

## Table K.1

```{r}

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_long, Thermo_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_long, Thermo_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_long, Thermo_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_long, Thermo_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_long, Good_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_long, Good_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_long, Good_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_long, Good_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("%stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: PSD leaders, thermometer scores - model 1; PSD, thermometer scores - model 2; PSD members and sympathizers, thermometer scores - model 3; PSD voters, thermometer scores - model 4; PSD leaders, Best for Romania scores - model 5; PSD, Best for Romania scores - model 6; PSD members and sympathizers, Best for Romania scores - model 7; PSD voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table K.2

```{r}

models_psd12 = list()

models_psd12[[1]] = lm(data = data12, Thermo_diff_PSD_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[2]] = lm(data = data12, Thermo_diff_PSD_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[3]] = lm(data = data12, Thermo_diff_PSD_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[4]] = lm(data = data12, Thermo_diff_PSD_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[5]] = lm(data = data12, Good_diff_PSD_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[6]] = lm(data = data12, Good_diff_PSD_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[7]] = lm(data = data12, Good_diff_PSD_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[8]] = lm(data = data12, Good_diff_PSD_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_psd12, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period"), reorder.coef = c(2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "Affective polarization towards the PSD - Waves 1 and 2 (cross-sectional data)")
```

## Table K.3

```{r}

models_psd12 = list()

models_psd12[[1]] = lm(data = data12, Thermo_PSD_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[2]] = lm(data = data12, Thermo_PSD_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[3]] = lm(data = data12, Thermo_PSD_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[4]] = lm(data = data12, Thermo_PSD_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[5]] = lm(data = data12, Good_PSD_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[6]] = lm(data = data12, Good_PSD_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[7]] = lm(data = data12, Good_PSD_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd12[[8]] = lm(data = data12, Good_PSD_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_psd12, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period"), reorder.coef = c(2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of the election on affective polarization - Waves 1 and 2 (cross-sectional data) - alternative measure of the dependent variable")
```

## Table K.4

```{r}

models_PNL12 = list()

models_PNL12[[1]] = felm(data = w12_long, Thermo_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[2]] = felm(data = w12_long, Thermo_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[3]] = felm(data = w12_long, Thermo_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[4]] = felm(data = w12_long, Thermo_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[5]] = felm(data = w12_long, Good_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[6]] = felm(data = w12_long, Good_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[7]] = felm(data = w12_long, Good_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[8]] = felm(data = w12_long, Good_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_PNL12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table K.5

```{r}

models_PNL12 = list()

models_PNL12[[1]] = felm(data = w12_long, Thermo_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[2]] = felm(data = w12_long, Thermo_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[3]] = felm(data = w12_long, Thermo_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[4]] = felm(data = w12_long, Thermo_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[5]] = felm(data = w12_long, Good_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[6]] = felm(data = w12_long, Good_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[7]] = felm(data = w12_long, Good_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[8]] = felm(data = w12_long, Good_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_PNL12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: PNL leaders, thermometer scores - model 1; PNL, thermometer scores - model 2; PNL members and sympathizers, thermometer scores - model 3; PNL voters, thermometer scores - model 4; PNL leaders, Best for Romania scores - model 5; PNL, Best for Romania scores - model 6; PNL members and sympathizers, Best for Romania scores - model 7; PNL voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table K.6

```{r}

models_PNL12 = list()

models_PNL12[[1]] = lm(data = data12, Thermo_diff_PNL_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[2]] = lm(data = data12, Thermo_diff_PNL_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[3]] = lm(data = data12, Thermo_diff_PNL_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[4]] = lm(data = data12, Thermo_diff_PNL_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[5]] = lm(data = data12, Good_diff_PNL_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[6]] = lm(data = data12, Good_diff_PNL_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[7]] = lm(data = data12, Good_diff_PNL_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[8]] = lm(data = data12, Good_diff_PNL_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_PNL12, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period"), reorder.coef = c(2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of the election on affective polarization - Waves 1 and 2 (cross-sectional data)")
```

## Table K.7

```{r}

models_PNL12 = list()

models_PNL12[[1]] = lm(data = data12, Thermo_PNL_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[2]] = lm(data = data12, Thermo_PNL_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[3]] = lm(data = data12, Thermo_PNL_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[4]] = lm(data = data12, Thermo_PNL_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[5]] = lm(data = data12, Good_PNL_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[6]] = lm(data = data12, Good_PNL_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[7]] = lm(data = data12, Good_PNL_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL12[[8]] = lm(data = data12, Good_PNL_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_PNL12, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period"), reorder.coef = c(2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: PNL leaders, thermometer scores - model 1; PNL, thermometer scores - model 2; PNL members and sympathizers, thermometer scores - model 3; PNL voters, thermometer scores - model 4; PNL leaders, Best for Romania scores - model 5; PNL, Best for Romania scores - model 6; PNL members and sympathizers, Best for Romania scores - model 7; PNL voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of the election on affective polarization - Waves 1 and 2 (cross-sectional data) - alternative measure of the dependent variable")
```

## Table L.1

```{r}

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_long, Thermo_diff_PSD_leaders_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_long, Thermo_diff_PSD_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_long, Thermo_diff_PSD_members_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_long, Thermo_diff_PSD_voters_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_long, Good_diff_PSD_leaders_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_long, Good_diff_PSD_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_long, Good_diff_PSD_members_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_long, Good_diff_PSD_voters_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("USR-PLUS Social identity", "Delegate", "USR-PLUS Social identity x Delegate"), reorder.coef = c(3, 2, 1), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table L.2

```{r}

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_long, Thermo_diff_PNL_leaders_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_long, Thermo_diff_PNL_s ~ Identity_USRPLUS_s*Delegate_v2| RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_long, Thermo_diff_PNL_members_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_long, Thermo_diff_PNL_voters_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_long, Good_diff_PNL_leaders_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_long, Good_diff_PNL_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_long, Good_diff_PNL_members_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_long, Good_diff_PNL_voters_s ~ Identity_USRPLUS_s*Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("USR-PLUS Social identity", "Delegate", "USR-PLUS Social identity x Delegate"), reorder.coef = c(3, 2, 1), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table L.3

```{r}

users_to_drop <- w12_long %>%
  filter(Past_delegate_observer_yes == 1 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Delegate_v2| RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that have served as delegates or observers in the past."))
```

## Table L.4

```{r}

users_to_drop <- w12_long %>%
  filter(Past_delegate_observer_yes == 1 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Delegate_v2| RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that have served as delegates or observers in the past."))
```

## Table L.5

```{r}

users_to_drop <- w12_long %>%
  filter(Close_ones_PSD %in% c(1, 2, 3) & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that have close ones supporting PSD."))
```

## Table L.6

```{r}

users_to_drop <- w12_long %>%
  filter(Close_ones_PNL %in% c(1, 2, 3) & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that have close ones supporting PNL."))
```

## Table L.7

```{r}

users_to_drop <- w12_long %>%
  filter(Recent_discussions_PSD %in% c(1, 2) & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that had recent discussions with PSD supporters."))
```

## Table L.8

```{r}

users_to_drop <- w12_long %>%
  filter(Recent_discussions_PNL %in% c(1, 2) & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that had recent discussions with PNL supporters."))
```

## Table L.9

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_diff_firsttwo_less5 == 1 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates from competitive precincts (less than 5% the difference between the first two parties)."))
```

## Table L.10

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_diff_firsttwo_less5 == 1 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates from competitive precincts (less than 5% the difference between the first two parties)."))
```

## Table L.11

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_USRPLUS_standing_12 == 1 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates from precincts in which USR-PLUS had good standing (first or second)."))
```

## Table L.12

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_USRPLUS_standing_12 == 1 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)


models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates from precincts in which USR-PLUS had good standing (first or second)."))
```

## Table L.13

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_eval_voting_incidents == 1 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that report precinct-level voting incidents."))
```

## Table L.14

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_eval_voting_incidents == 1 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that report precinct-level voting incidents."))
```

## Table L.15

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_discussions_PSD_yes == 0 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that did not have discussions with PSD representatives."))
```

## Table L.16

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_discussions_PNL_yes == 0 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)


models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that did not have discussions with PNL representatives."))
```

## Table L.17

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_interactions_PSD_tensed == 1 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that did have tense interactions with PSD representatives."))
```

## Table L.18

```{r}

users_to_drop <- w12_long %>%
  filter(Precinct_interactions_PNL_tensed == 1 & Delegate_vote_total == 1) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects. The estimations exclude the delegates that did have tense interactions with PNL representatives."))
```

## Table M.1

```{r}

users_to_drop <- w12_long %>%
  filter(Nondelegates_activity_votingday != "No political activity" & Delegate_vote_total == 0) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("%stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table M.2

```{r}

users_to_drop <- w12_long %>%
  filter(Nondelegates_activity_votingday != "No political activity" & Delegate_vote_total == 0) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_PNL12 = list()

models_PNL12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_PNL12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table M.3

```{r}

users_to_drop <- w13_long %>%
  filter(Nondelegates_activity_votingday != "No political activity" & Delegate_vote_total == 0) %>%
  pull(RecipientFirstName) %>%
  unique()

w13_select = filter(w13_long, RecipientFirstName %nin% users_to_drop)

models_psd13 = list()

models_psd13[[1]] = felm(data = w13_select, Thermo_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[2]] = felm(data = w13_select, Thermo_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[3]] = felm(data = w13_select, Thermo_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[4]] = felm(data = w13_select, Thermo_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[5]] = felm(data = w13_select, Good_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[6]] = felm(data = w13_select, Good_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[7]] = felm(data = w13_select, Good_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[8]] = felm(data = w13_select, Good_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_psd13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("%stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table M.4

```{r}

users_to_drop <- w13_long %>%
  filter(Nondelegates_activity_votingday != "No political activity" & Delegate_vote_total == 0) %>%
  pull(RecipientFirstName) %>%
  unique()

w13_select = filter(w13_long, RecipientFirstName %nin% users_to_drop)

models_PNL13 = list()

models_PNL13[[1]] = felm(data = w13_select, Thermo_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[2]] = felm(data = w13_select, Thermo_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[3]] = felm(data = w13_select, Thermo_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[4]] = felm(data = w13_select, Thermo_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[5]] = felm(data = w13_select, Good_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[6]] = felm(data = w13_select, Good_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[7]] = felm(data = w13_select, Good_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[8]] = felm(data = w13_select, Good_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_PNL13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table M.5

```{r}

users_to_drop <- w12_long %>%
  filter(Nondelegates_activity_votingday != "No political activity" & Delegate_vote_total == 0) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table M.6

```{r}

users_to_drop <- w12_long %>%
  filter(Nondelegates_activity_votingday != "No political activity" & Delegate_vote_total == 0) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table M.7

```{r}

users_to_drop <- w13_long %>%
  filter(Nondelegates_activity_votingday != "No political activity" & Delegate_vote_total == 0) %>%
  pull(RecipientFirstName) %>%
  unique()

w13_select = filter(w13_long, RecipientFirstName %nin% users_to_drop)

models_psd13 = list()

models_psd13[[1]] = felm(data = w13_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[2]] = felm(data = w13_select, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[3]] = felm(data = w13_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[4]] = felm(data = w13_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[5]] = felm(data = w13_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[6]] = felm(data = w13_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[7]] = felm(data = w13_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[8]] = felm(data = w13_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table M.8

```{r}

users_to_drop <- w13_long %>%
  filter(Nondelegates_activity_votingday != "No political activity" & Delegate_vote_total == 0) %>%
  pull(RecipientFirstName) %>%
  unique()

w13_select = filter(w13_long, RecipientFirstName %nin% users_to_drop)

models_pnl13 = list()

models_pnl13[[1]] = felm(data = w13_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[2]] = felm(data = w13_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[3]] = felm(data = w13_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[4]] = felm(data = w13_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[5]] = felm(data = w13_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[6]] = felm(data = w13_select, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[7]] = felm(data = w13_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[8]] = felm(data = w13_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Figure N.1

```{r}

# Thermometer scores - Affective polarization USRPLUS - PSD

w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_diff_PSD_leaders, Thermo_diff_PSD, Thermo_diff_PSD_members, Thermo_diff_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
   drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "3"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 3\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_diff_PSD_leaders",  "Thermo_diff_PSD", "Thermo_diff_PSD_members", "Thermo_diff_PSD_voters"),
                      labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nThermometer Score", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureN1_w13_Thermo_PSD_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best scores - Affective polarization USRPLUS - PSD

w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Good_diff_PSD_leaders, Good_diff_PSD, Good_diff_PSD_members, Good_diff_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
   drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "3"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 3\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_diff_PSD_leaders", "Good_diff_PSD", "Good_diff_PSD_members", "Good_diff_PSD_voters"),
                      labels = c("USR-PLUS - PSD\nleaders", "USR-PLUS - PSD", "USR-PLUS - PSD\nmembers and\nsympathizers", "USR-PLUS - PSD\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nthe Best for Romania variable", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureN1_w13_Good_PSD_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")
```

## Figure N.2

```{r}

# Thermometer scores - PSD

w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_PSD_leaders, Thermo_PSD, Thermo_PSD_members, Thermo_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
   drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "3"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 3\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_PSD_leaders",  "Thermo_PSD", "Thermo_PSD_members", "Thermo_PSD_voters"),
                      labels = c("PSD\nleaders", "PSD", "PSD\nmembers and\nsympathizers", "PSD\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean\nThermometer Score", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureN2_w13_Thermo_PSD_delegates_uns_alt.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best scores - PSD

w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave,  Good_PSD_leaders, Good_PSD, Good_PSD_members, Good_PSD_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
   drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "3"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 3\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_PSD_leaders", "Good_PSD", "Good_PSD_members", "Good_PSD_voters"),
                      labels = c("PSD\nleaders", "PSD", "PSD\nmembers and\nsympathizers", "PSD\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean\nthe Best for Romania variable", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureN2_Good_PSD_delegates_uns_alt.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")
```

## Table N.1

```{r}

models_psd13 = list()

models_psd13[[1]] = felm(data = w13_long, Thermo_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[2]] = felm(data = w13_long, Thermo_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[3]] = felm(data = w13_long, Thermo_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[4]] = felm(data = w13_long, Thermo_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[5]] = felm(data = w13_long, Good_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[6]] = felm(data = w13_long, Good_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[7]] = felm(data = w13_long, Good_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd13[[8]] = felm(data = w13_long, Good_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: PSD leaders, thermometer scores - model 1; PSD, thermometer scores - model 2; PSD members and sympathizers, thermometer scores - model 3; PSD voters, thermometer scores - model 4; PSD leaders, Best for Romania scores - model 5; PSD, Best for Romania scores - model 6; PSD members and sympathizers, Best for Romania scores - model 7; PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table N.2

```{r}

models_psd13 = list()

models_psd13[[1]] = lm(data = data13, Thermo_diff_PSD_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[2]] = lm(data = data13, Thermo_diff_PSD_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[3]] = lm(data = data13, Thermo_diff_PSD_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[4]] = lm(data = data13, Thermo_diff_PSD_voters_s ~ Period*Delegate_vote_total  + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[5]] = lm(data = data13, Good_diff_PSD_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[6]] = lm(data = data13, Good_diff_PSD_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[7]] = lm(data = data13, Good_diff_PSD_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[8]] = lm(data = data13, Good_diff_PSD_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_psd13, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period", "Delegate", "Delegate x Post-election period"), reorder.coef = c(4, 3, 2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of observing the election on affective polarization towards PSD - Waves 1 and 3 (cross-sectional data)")
```

## Table N.3

```{r}

models_psd13 = list()

models_psd13[[1]] = lm(data = data13, Thermo_PSD_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[2]] = lm(data = data13, Thermo_PSD_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[3]] = lm(data = data13, Thermo_PSD_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[4]] = lm(data = data13, Thermo_PSD_voters_s ~ Period*Delegate_vote_total  + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[5]] = lm(data = data13, Good_PSD_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[6]] = lm(data = data13, Good_PSD_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[7]] = lm(data = data13, Good_PSD_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[8]] = lm(data = data13, Good_PSD_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_psd13, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period", "Delegate", "Delegate x Post-election period"), reorder.coef = c(4, 3, 2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: PSD leaders, thermometer scores - model 1; PSD, thermometer scores - model 2; PSD members and sympathizers, thermometer scores - model 3; PSD voters, thermometer scores - model 4; PSD leaders, Best for Romania scores - model 5; PSD, Best for Romania scores - model 6; PSD members and sympathizers, Best for Romania scores - model 7; PSD voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of observing the election on affective polarization towards PSD - Waves 1 and 2 (cross-sectional data) - alternative measure of the dependent variable")
```

## Figure N.3

```{r}

# Thermometer scores - Affective polarization USRPLUS - PNL

w13_wide = w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters) %>%
  pivot_wider(
    id_cols = RecipientFirstName,
    names_from = Wave,
    values_from = c(Delegate_vote_total, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters)) %>%
  mutate(w13_PNL_leaders = Thermo_diff_PNL_leaders_3 - Thermo_diff_PNL_leaders_1,
         w13_PNL = Thermo_diff_PNL_3 - Thermo_diff_PNL_1,
         w13_PNL_members = Thermo_diff_PNL_members_3 - Thermo_diff_PNL_members_1,
         w13_PNL_voters = Thermo_diff_PNL_voters_3 - Thermo_diff_PNL_voters_1)

w13_wide %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total_1, w13_PNL_leaders, w13_PNL, w13_PNL_members, w13_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total_1), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total_1, Variable) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                           levels = c("w13_PNL_leaders",  "w13_PNL", "w13_PNL_members", "w13_PNL_voters"),
                           labels = c("USR-PLUS - PNL\nleaders\n(Wave 3 - Wave 1)", "USR-PLUS - PNL\n(Wave 3 - Wave 1)", "USR-PLUS - PNL\nmembers and\nsympathizers\n(Wave 3 - Wave 1)", "USR-PLUS - PNL\nvoters\n(Wave 3 - Wave 1)"))) %>%  
  ggplot(aes(x = Variable, y = diff), group = as.factor(Delegate_vote_total_1)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total_1), color = as.factor(Delegate_vote_total_1)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total_1)), position=position_dodge(.2), size = 4) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black", size = 1) +
  labs(y = "Mean Difference in\nThermometer Score\n(Wave 3 - Wave 1)", x = "") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureN3_w13_Thermo_PNL_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best scores - Affective polarization USRPLUS - PNL

w13_wide1 = w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters) %>%
  pivot_wider(
    id_cols = RecipientFirstName,
    names_from = Wave,
    values_from = c(Delegate_vote_total, Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters)) %>%
  mutate(w13_PNL_leaders = Good_diff_PNL_leaders_3 - Good_diff_PNL_leaders_1,
         w13_PNL = Good_diff_PNL_3 - Good_diff_PNL_1,
         w13_PNL_members = Good_diff_PNL_members_3 - Good_diff_PNL_members_1,
         w13_PNL_voters = Good_diff_PNL_voters_3 - Good_diff_PNL_voters_1)

w13_wide1 %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total_1, w13_PNL_leaders, w13_PNL, w13_PNL_members, w13_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total_1), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total_1, Variable) %>%
  drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Variable = factor(Variable, ordered = TRUE, 
                      levels = c("w13_PNL_leaders", "w13_PNL", "w13_PNL_members", "w13_PNL_voters"),
                      labels = c("USR-PLUS - PNL\nleaders\n(Wave 3 - Wave 1)", "USR-PLUS - PNL\n(Wave 3 - Wave 1)", "USR-PLUS - PNL\nmembers and\nsympathizers\n(Wave 3 - Wave 1)", "USR-PLUS - PNL\nvoters\n(Wave 3 - Wave 1)"))) %>%  
  ggplot(aes(x = Variable, y = diff), group = as.factor(Delegate_vote_total_1)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total_1), color = as.factor(Delegate_vote_total_1)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total_1)), position=position_dodge(.2), size = 4) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "black", size = 1) +
  labs(y = "Mean Difference in\nthe Best for Romania variable\n(Wave 3 - Wave 1)", x = "") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureN3_w13_Good_PNL_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")
```

## Figure N.4

```{r}

# Thermometer scores - Affective polarization USRPLUS - PNL

w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_diff_PNL_leaders, Thermo_diff_PNL, Thermo_diff_PNL_members, Thermo_diff_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
   drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "3"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 3\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_diff_PNL_leaders",  "Thermo_diff_PNL", "Thermo_diff_PNL_members", "Thermo_diff_PNL_voters"),
                      labels = c("USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nThermometer Score", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
 scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureN4_w13_Thermo_PNL_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best scores - Affective polarization USRPLUS - PNL

w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave,  Good_diff_PNL_leaders, Good_diff_PNL, Good_diff_PNL_members, Good_diff_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
   drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "3"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 3\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_diff_PNL_leaders", "Good_diff_PNL", "Good_diff_PNL_members", "Good_diff_PNL_voters"),
                      labels = c("USR-PLUS - PNL\nleaders", "USR-PLUS - PNL", "USR-PLUS - PNL\nmembers and\nsympathizers", "USR-PLUS - PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean Difference in\nthe Best for Romania variable", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
 scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureN4_w13_Good_PNL_delegates_uns.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")
```

## Table N.4

```{r}

models_pnl13 = list()

models_pnl13[[1]] = felm(data = w13_long, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[2]] = felm(data = w13_long, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[3]] = felm(data = w13_long, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[4]] = felm(data = w13_long, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[5]] = felm(data = w13_long, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[6]] = felm(data = w13_long, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[7]] = felm(data = w13_long, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[8]] = felm(data = w13_long, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table N.5

```{r}

models_pnl13 = list()

models_pnl13[[1]] = felm(data = w13_long, Thermo_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[2]] = felm(data = w13_long, Thermo_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[3]] = felm(data = w13_long, Thermo_PNL_members_s ~ Delegate_v2| RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[4]] = felm(data = w13_long, Thermo_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[5]] = felm(data = w13_long, Good_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[6]] = felm(data = w13_long, Good_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[7]] = felm(data = w13_long, Good_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl13[[8]] = felm(data = w13_long, Good_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: PNL leaders, thermometer scores - model 1; PNL, thermometer scores - model 2; PNL members and sympathizers, thermometer scores - model 3; PNL voters, thermometer scores - model 4; PNL leaders, Best for Romania scores - model 5; PNL, Best for Romania scores - model 6; PNL members and sympathizers, Best for Romania scores - model 7; PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Figure N.5

```{r}

# Thermometer scores - PNL

w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave, Thermo_PNL_leaders, Thermo_PNL, Thermo_PNL_members, Thermo_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
   drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "3"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 3\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Thermo_PNL_leaders",  "Thermo_PNL", "Thermo_PNL_members", "Thermo_PNL_voters"),
                      labels = c("PNL\nleaders", "PNL", "PNL\nmembers and\nsympathizers", "PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean\nThermometer Score", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureN5_w13_Thermo_PNL_delegates_uns_alt.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")

# Best scores - PNL

w13_long %>%
  dplyr::select(RecipientFirstName, Delegate_vote_total, Wave,  Good_PNL_leaders, Good_PNL, Good_PNL_members, Good_PNL_voters) %>%
  pivot_longer(-c(RecipientFirstName, Delegate_vote_total, Wave), names_to = "Variable", values_to = "Value") %>%
  group_by(Delegate_vote_total, Variable, Wave) %>%
   drop_na %>%
  dplyr::summarise(diff = mean(Value, na.rm = T),
            se = sciplot::se(Value, na.rm = T)) %>%
  mutate(Wave = factor(Wave, ordered = TRUE, 
                       levels = c("1",  "3"),
                       labels = c("Wave 1\n(Pre-election)", "Wave 3\n(Post-election)")),
             Variable = factor(Variable, ordered = TRUE, 
                      levels = c("Good_PNL_leaders", "Good_PNL", "Good_PNL_members", "Good_PNL_voters"),
                      labels = c("PNL\nleaders", "PNL", "PNL\nmembers and\nsympathizers", "PNL\nvoters"))) %>%  
  ggplot(aes(x = as.factor(Wave), y = diff), group = as.factor(Delegate_vote_total)) +
  geom_errorbar(aes(ymin = diff - 1.96*se, ymax = diff + 1.96*se, group = as.factor(Delegate_vote_total), color = as.factor(Delegate_vote_total)), width = 0, position=position_dodge(.2), size = 2) + 
  geom_point(aes(color = as.factor(Delegate_vote_total)), position=position_dodge(.2), size = 4) +
  labs(y = "Mean\nthe Best for Romania variable", x = "") +
  facet_grid(~Variable, scales = "free_x") +
  theme +
  theme(legend.position = "top") +
  theme(legend.title = element_blank()) +
  scale_color_hue(labels = c("1" =  "Party\nDelegates\n(Treatment)", "0" = "Party\nNon-delegates\n(Control)"), h = c(180, 270))

ggsave("Plots/FigureN5_w13_Good_PNL_delegates_uns_alt.pdf", dpi = 1200, width = 17.5, height = 10, unit = "in")
```

## Table N.6

```{r}

models_PNL13 = list()

models_PNL13[[1]] = lm(data = data13, Thermo_diff_PNL_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[2]] = lm(data = data13, Thermo_diff_PNL_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[3]] = lm(data = data13, Thermo_diff_PNL_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[4]] = lm(data = data13, Thermo_diff_PNL_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[5]] = lm(data = data13, Good_diff_PNL_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[6]] = lm(data = data13, Good_diff_PNL_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[7]] = lm(data = data13, Good_diff_PNL_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[8]] = lm(data = data13, Good_diff_PNL_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_PNL13, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period", "Delegate", "Delegate x Post-election period"), reorder.coef = c(4, 3, 2, 1),  custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of observing the election on affective polarization towards PNL - Waves 1 and 3 (cross-sectional data)")
```

## Table N.7

```{r}

models_PNL13 = list()

models_PNL13[[1]] = lm(data = data13, Thermo_PNL_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[2]] = lm(data = data13, Thermo_PNL_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[3]] = lm(data = data13, Thermo_PNL_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[4]] = lm(data = data13, Thermo_PNL_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[5]] = lm(data = data13, Good_PNL_leaders_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[6]] = lm(data = data13, Good_PNL_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[7]] = lm(data = data13, Good_PNL_members_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[8]] = lm(data = data13, Good_PNL_voters_s ~ Period*Delegate_vote_total + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_PNL13, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period", "Delegate", "Delegate x Post-election period"), reorder.coef = c(4, 3, 2, 1),  custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: PNL leaders, thermometer scores - model 1; PNL, thermometer scores - model 2; PNL members and sympathizers, thermometer scores - model 3; PNL voters, thermometer scores - model 4; PNL leaders, Best for Romania scores - model 5; PNL, Best for Romania scores - model 6; PNL members and sympathizers, Best for Romania scores - model 7; PNL voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of observing the election on affective polarization towards PNL - Waves 1 and 2 (cross-sectional data) - alternative measure of the dependent variable")
```

## Table O.1

```{r}

models_psd13 = list()

models_psd13[[1]] = felm(data = w13_long, Thermo_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[2]] = felm(data = w13_long, Thermo_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[3]] = felm(data = w13_long, Thermo_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[4]] = felm(data = w13_long, Thermo_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[5]] = felm(data = w13_long, Good_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[6]] = felm(data = w13_long, Good_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[7]] = felm(data = w13_long, Good_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[8]] = felm(data = w13_long, Good_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_psd13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table O.2

```{r}

models_psd13 = list()

models_psd13[[1]] = felm(data = w13_long, Thermo_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[2]] = felm(data = w13_long, Thermo_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[3]] = felm(data = w13_long, Thermo_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[4]] = felm(data = w13_long, Thermo_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[5]] = felm(data = w13_long, Good_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[6]] = felm(data = w13_long, Good_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[7]] = felm(data = w13_long, Good_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd13[[8]] = felm(data = w13_long, Good_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_psd13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors in parentheses. Dependent variables for each model: PSD leaders, thermometer scores - model 1; PSD, thermometer scores - model 2; PSD members and sympathizers, thermometer scores - model 3; PSD voters, thermometer scores - model 4; PSD leaders, Best for Romania scores - model 5; PSD, Best for Romania scores - model 6; PSD members and sympathizers, Best for Romania scores - model 7; PSD voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table O.3

```{r}

models_psd13 = list()

models_psd13[[1]] = lm(data = data13, Thermo_diff_PSD_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[2]] = lm(data = data13, Thermo_diff_PSD_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[3]] = lm(data = data13, Thermo_diff_PSD_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[4]] = lm(data = data13, Thermo_diff_PSD_voters_s ~ Period  + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[5]] = lm(data = data13, Good_diff_PSD_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[6]] = lm(data = data13, Good_diff_PSD_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[7]] = lm(data = data13, Good_diff_PSD_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[8]] = lm(data = data13, Good_diff_PSD_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_psd13, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period"), reorder.coef = c(2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of the election on affective polarization - Waves 1 and 3 (cross-sectional data)")
```

## Table O.4

```{r}

models_psd13 = list()

models_psd13[[1]] = lm(data = data13, Thermo_PSD_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[2]] = lm(data = data13, Thermo_PSD_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[3]] = lm(data = data13, Thermo_PSD_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[4]] = lm(data = data13, Thermo_PSD_voters_s ~ Period  + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[5]] = lm(data = data13, Good_PSD_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[6]] = lm(data = data13, Good_PSD_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[7]] = lm(data = data13, Good_PSD_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_psd13[[8]] = lm(data = data13, Good_PSD_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_psd13, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period"), reorder.coef = c(2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: PSD leaders, thermometer scores - model 1; PSD, thermometer scores - model 2; PSD members and sympathizers, thermometer scores - model 3; PSD voters, thermometer scores - model 4; PSD leaders, Best for Romania scores - model 5; PSD, Best for Romania scores - model 6; PSD members and sympathizers, Best for Romania scores - model 7; PSD voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of the election on affective polarization - Waves 1 and 3 (cross-sectional data) - alternative measure of the dependent variable")
```

## Table O.5

```{r}

models_PNL13 = list()

models_PNL13[[1]] = felm(data = w13_long, Thermo_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[2]] = felm(data = w13_long, Thermo_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[3]] = felm(data = w13_long, Thermo_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[4]] = felm(data = w13_long, Thermo_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[5]] = felm(data = w13_long, Good_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[6]] = felm(data = w13_long, Good_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[7]] = felm(data = w13_long, Good_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[8]] = felm(data = w13_long, Good_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_PNL13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table O.6

```{r}

models_PNL13 = list()

models_PNL13[[1]] = felm(data = w13_long, Thermo_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[2]] = felm(data = w13_long, Thermo_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[3]] = felm(data = w13_long, Thermo_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[4]] = felm(data = w13_long, Thermo_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[5]] = felm(data = w13_long, Good_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[6]] = felm(data = w13_long, Good_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[7]] = felm(data = w13_long, Good_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL13[[8]] = felm(data = w13_long, Good_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_PNL13, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: PNL leaders, thermometer scores - model 1; PNL, thermometer scores - model 2; PNL members and sympathizers, thermometer scores - model 3; PNL voters, thermometer scores - model 4; PNL leaders, Best for Romania scores - model 5; PNL, Best for Romania scores - model 6; PNL members and sympathizers, Best for Romania scores - model 7; PNL voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table O.7

```{r}

models_PNL13 = list()

models_PNL13[[1]] = lm(data = data13, Thermo_diff_PNL_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[2]] = lm(data = data13, Thermo_diff_PNL_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[3]] = lm(data = data13, Thermo_diff_PNL_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[4]] = lm(data = data13, Thermo_diff_PNL_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[5]] = lm(data = data13, Good_diff_PNL_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[6]] = lm(data = data13, Good_diff_PNL_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[7]] = lm(data = data13, Good_diff_PNL_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[8]] = lm(data = data13, Good_diff_PNL_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_PNL13, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period"), reorder.coef = c(2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of the election on affective polarization - Waves 1 and 3 (cross-sectional data)")
```

## Table O.8

```{r}

models_PNL13 = list()

models_PNL13[[1]] = lm(data = data13, Thermo_PNL_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[2]] = lm(data = data13, Thermo_PNL_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[3]] = lm(data = data13, Thermo_PNL_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[4]] = lm(data = data13, Thermo_PNL_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[5]] = lm(data = data13, Good_PNL_leaders_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[6]] = lm(data = data13, Good_PNL_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[7]] = lm(data = data13, Good_PNL_members_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

models_PNL13[[8]] = lm(data = data13, Good_PNL_voters_s ~ Period + Age + Female + Education + Urban + Ethnicity + Marital_status + Income_objective + Income_subjective + Political_efficacy + Ideology + Political_news)

screenreg(models_PNL13, omit.coef =  "Age|Female|Education|Urban|Ethnicity|Marital_status|Income_objective|Income_subjective|Political_efficacy|Ideology|Political_news", single.row = F, custom.coef.names = c("Intercept", "Post-election period"), reorder.coef = c(2, 1), custom.note = c("Note: %stars. OLS estimations with standard errors in parentheses. Dependent variables for each model: PNL leaders, thermometer scores - model 1; PNL, thermometer scores - model 2; PNL members and sympathizers, thermometer scores - model 3; PNL voters, thermometer scores - model 4; PNL leaders, Best for Romania scores - model 5; PNL, Best for Romania scores - model 6; PNL members and sympathizers, Best for Romania scores - model 7; PNL voters, Best for Romania scores - model 8. The model controls for age, sex, education, urban residence, ethnicity, marital status, income (objective), income (subjective), political efficacy, ideology, and political news."), caption.above = T, caption = "The impact of the election on affective polarization - Waves 1 and 3 (cross-sectional data) - alternative measure of the dependent variable")
```

## Table P.1

```{r}

users_to_drop <- w12_long %>%
  filter(Date > "2020-12-09" & Wave == 2) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("%stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table P.2

```{r}

users_to_drop <- w12_long %>%
  filter(Date > "2020-12-09" & Wave == 2) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_PNL12 = list()

models_PNL12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_PNL12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_PNL12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent fixed effects."))
```

## Table P.3

```{r}

users_to_drop <- w12_long %>%
  filter(Date > "2020-12-09" & Wave == 2) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_psd12 = list()

models_psd12[[1]] = felm(data = w12_select, Thermo_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[2]] = felm(data = w12_select, Thermo_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[3]] = felm(data = w12_select, Thermo_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[4]] = felm(data = w12_select, Thermo_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[5]] = felm(data = w12_select, Good_diff_PSD_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[6]] = felm(data = w12_select, Good_diff_PSD_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[7]] = felm(data = w12_select, Good_diff_PSD_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_psd12[[8]] = felm(data = w12_select, Good_diff_PSD_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_psd12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PSD leaders, thermometer scores - model 1; USR-PLUS - PSD, thermometer scores - model 2; USR-PLUS - PSD members and sympathizers, thermometer scores - model 3; USR-PLUS - PSD voters, thermometer scores - model 4; USR-PLUS - PSD leaders, Best for Romania scores - model 5; USR-PLUS - PSD, Best for Romania scores - model 6; USR-PLUS - PSD members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PSD voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table P.4

```{r}

users_to_drop <- w12_long %>%
  filter(Date > "2020-12-09" & Wave == 2) %>%
  pull(RecipientFirstName) %>%
  unique()

w12_select = filter(w12_long, RecipientFirstName %nin% users_to_drop)

models_pnl12 = list()

models_pnl12[[1]] = felm(data = w12_select, Thermo_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[2]] = felm(data = w12_select, Thermo_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[3]] = felm(data = w12_select, Thermo_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[4]] = felm(data = w12_select, Thermo_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[5]] = felm(data = w12_select, Good_diff_PNL_leaders_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[6]] = felm(data = w12_select, Good_diff_PNL_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[7]] = felm(data = w12_select, Good_diff_PNL_members_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_pnl12[[8]] = felm(data = w12_select, Good_diff_PNL_voters_s ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_pnl12, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables for each model: USR-PLUS - PNL leaders, thermometer scores - model 1; USR-PLUS - PNL, thermometer scores - model 2; USR-PLUS - PNL members and sympathizers, thermometer scores - model 3; USR-PLUS - PNL voters, thermometer scores - model 4; USR-PLUS - PNL leaders, Best for Romania scores - model 5; USR-PLUS - PNL, Best for Romania scores - model 6; USR-PLUS - PNL members and sympathizers, Best for Romania scores - model 7; USR-PLUS - PNL voters, Best for Romania scores - model 8. The models include respondent and wave fixed effects."))
```

## Table Q.1

```{r}

models_never_nodel = list()

models_never_nodel[[1]] = felm(data = w12_long, PSD_never_vote ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_never_nodel[[2]] = felm(data = w12_long, PNL_never_vote ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_never_nodel[[3]] = felm(data = w13_long, PSD_never_vote ~ Wave | RecipientFirstName| 0| RecipientFirstName)

models_never_nodel[[4]] = felm(data = w13_long, PNL_never_vote ~ Wave | RecipientFirstName| 0| RecipientFirstName)

screenreg(models_never_nodel, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName", custom.coef.names = c("Post-election period"), custom.note = c("%stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables: probability of never voting for PSD - models 1 and 3; probability of never voting for PNL - models 2 and 4. The models include respondent fixed effects. Models 1 and 2 are estimated on the panel that includes the first two waves, whereas models 3 and 4 on the panel that includes waves 1 and 3."))
```

## Table Q.2

```{r}

models_never_del = list()

models_never_del[[1]] = felm(data = w12_long, PSD_never_vote ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_never_del[[2]] = felm(data = w12_long, PNL_never_vote ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_never_del[[3]] = felm(data = w13_long, PSD_never_vote ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

models_never_del[[4]] = felm(data = w13_long, PNL_never_vote ~ Delegate_v2 | RecipientFirstName + Wave | 0| RecipientFirstName)

screenreg(models_never_del, single.row = F, stars = c(0.01, 0.05, 0.1), omit.coef = "RecipientFirstName|Wave", custom.coef.names = c("Delegate"), custom.note = c("Note: %stars. Fixed effects estimations with standard errors clustered at the respondent level in parentheses. Dependent variables: probability of never voting for PSD - models 1 and 3; probability of never voting for PNL - models 2 and 4. The models include respondent and wave fixed effects. Models 1 and 2 are estimated on the panel that includes the first two waves, whereas models 3 and 4 on the panel that includes waves 1 and 3."))
```
